473,386 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Line Break in MS Word Doc

49
Can anyone tell me how can i break a line in MS WORD doc thru VB 6.0 application? I'm replacing the field values with the data from the databse in MS WORD doc. One of my field value is ( "Jan tst. 020-4848074 intern\line \line App:\line inst. en progr. quattrovox op bestaande apparatuur.\line \line Infra:\line migratie met nr.beh. van 023-5259966 en 3 msn\line \line Instal:\line 3 x bigel t.b.v. 2 x PC en een tel.tst.\line \line contactpers: Mevr. Boorsma tel. 023-5252700 of 5274110\line klant bevetigen aub\line \line uren en monteur gepland in caps material bst via mast m.g.\line \line kanvas ok\line asn mjn*\line Zie informatie.... opdracht kan afgelast worden iom klant.\line") in which "\line"is there. When i replace the field value in WORD doc the big string comes in one line. But i want that where ever "\line" is there , it should come in new line. I tried various commands like "vbCrLf" and "Chr(13)". But nothing is working. Require help in this. All suggessions are welcome
Mar 5 '07 #1
3 3023
vijaydiwakar
579 512MB
Can anyone tell me how can i break a line in MS WORD doc thru VB 6.0 application? I'm replacing the field values with the data from the databse in MS WORD doc. One of my field value is ( "Jan tst. 020-4848074 intern\line \line App:\line inst. en progr. quattrovox op bestaande apparatuur.\line \line Infra:\line migratie met nr.beh. van 023-5259966 en 3 msn\line \line Instal:\line 3 x bigel t.b.v. 2 x PC en een tel.tst.\line \line contactpers: Mevr. Boorsma tel. 023-5252700 of 5274110\line klant bevetigen aub\line \line uren en monteur gepland in caps material bst via mast m.g.\line \line kanvas ok\line asn mjn*\line Zie informatie.... opdracht kan afgelast worden iom klant.\line") in which "\line"is there. When i replace the field value in WORD doc the big string comes in one line. But i want that where ever "\line" is there , it should come in new line. I tried various commands like "vbCrLf" and "Chr(13)". But nothing is working. Require help in this. All suggessions are welcome
try to use rich text box there u can feed line and then try to save that in word file
Mar 5 '07 #2
hariharanmca
1,977 1GB
Can anyone tell me how can i break a line in MS WORD doc thru VB 6.0 application? I'm replacing the field values with the data from the databse in MS WORD doc. One of my field value is ( "Jan tst. 020-4848074 intern\line \line App:\line inst. en progr. quattrovox op bestaande apparatuur.\line \line Infra:\line migratie met nr.beh. van 023-5259966 en 3 msn\line \line Instal:\line 3 x bigel t.b.v. 2 x PC en een tel.tst.\line \line contactpers: Mevr. Boorsma tel. 023-5252700 of 5274110\line klant bevetigen aub\line \line uren en monteur gepland in caps material bst via mast m.g.\line \line kanvas ok\line asn mjn*\line Zie informatie.... opdracht kan afgelast worden iom klant.\line") in which "\line"is there. When i replace the field value in WORD doc the big string comes in one line. But i want that where ever "\line" is there , it should come in new line. I tried various commands like "vbCrLf" and "Chr(13)". But nothing is working. Require help in this. All suggessions are welcome

i think u may use
Set objWord = CreateObject("Word.Application")
and
Set thisDoc = CreateObject("Word.Document")
so

Code here
------------------
thisDoc.Range.InsertAfter vbcrlf

this will help u
Mar 5 '07 #3
amitp
49
The thing is that i'm using Find and Replace method to replace the string to the particula field value in the document. The variable "lsVeldWaarde" gets the value from the database which is the big string. So where to put the code so that each substring inside the big string will come in a new line.

lsVeldWaarde = Replace(lsVeldWaarde, "\line", )
sReplace = lsVeldWaarde

With wrdApp4.ActiveDocument.Application.Selection.Find
.Text = sFind
.Replacement.Text = sReplace
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Mar 6 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Edd Dawson | last post by:
Hi. I have a strange problem involving the passing of command line arguments to a C program I'm writing. I tried posting this in comp.programming yesterday but someone kindly suggested that I'd...
11
by: name | last post by:
Here is a first attempt at a line/word wrapping utility. Seems to work okay, but lacks some checking stuff, etc. --------------------------------------------------------- #include <stdio.h>...
2
by: Zanna | last post by:
Hi all! I'm in difficulty with this: I need to know the height of a text line that is written with Graphics.DrawString(). In theory I need just to get the Graphics.MeasureString() result. But...
8
by: Frost | last post by:
Hi All, I am a newbie i have written a c program on unix for line by line comparison for two files now could some one help on how i could do word by word comparison in case both lines have the...
6
by: Markus Ernst | last post by:
Hi Searching for a possibility to display some text with preserved white space and line breaks, but with long lines being wrapped, I found this CSS declaration, which I found helpful: pre {...
2
by: MDB | last post by:
Hello All, I have a label in a form view that I need to have display the line breaks. Is there an easy way to do this? For some reason, I havn't been able to find a straigh answer on this. ...
2
by: patrik.nyman | last post by:
I'm doing markup of some original texts, and want to be able too optionally keep the line breaks of the original. But sometimes a word is hyphenated at a line break. At TEI-L I found the...
4
by: deerchao | last post by:
Hi, I'd like to render colorful text with word wrap on screen (kind of inline <fonttag to change text color in html), but run into the line break problem. Graphics provides several DrawString...
3
by: mithunm | last post by:
Hi, Currently i am facing a problem if my <td>***</td> contains value like aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa or something is better than nothing and we all know that then...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.