Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / July 2007

Tip: Looking for answers? Try searching our database.

Eliminating line item breaks

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Garbunkel - 10 Jul 2007 14:52 GMT
All,

I have been attempting to use a macro which generates a list of all
modifications made to a Word document past a certain date.  One of the
categories (columns) included in the output list is the current text in the
document (that is, the inserted sentence which has replaced the old text).

An example of the output:

DATE     PAGE    TYPE OF CHANGE    CURRENT TEXT

Each of these above columns (as well as each corresponding element in the
actual output) have a vbTab in between them.  Without eliminating the
linebreaks in the "Current Text" data, the text will wrap around to the next
line, which throws off the formatting, should I want to paste this into
Excel, or some other table.  What I'm after is keeping current text data as
one exclusive line.

I do not wish to create an output table in Word, since that makes the output
process take MUCH longer.

I have been using the following code to handle the "Current Text" data:
           While (InStr(1, CurrText, vbCr, vbBinaryCompare))
               CurrText = Replace(CurrText, vbCr, "   ", 1, ,
vbBinaryCompare)
           Wend

This works fine, except when I come across a numbered (or lettered) list.  I
have tried using vbLf & vbCrLf as well, but it does not find the list
linebreaks.

Any assistance that anyone can offer on how to overcome this is greatly
appreciated!
--
Russ - 10 Jul 2007 20:37 GMT
Garbunkel,
Does this information start you on the right track?
http://word.mvps.org/faqs/numbering/liststring.htm

Using their code example, you could check each paragraph for the listnumber
part and store it in a variable.
Then concatenate the list number string and the paragraph string.

> All,
>
[quoted text clipped - 29 lines]
> Any assistance that anyone can offer on how to overcome this is greatly
> appreciated!

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

Garbunkel - 11 Jul 2007 21:54 GMT
Thanks Russ,

This is a good starting point.  I'll try to incorporate this into the text
checking.
Signature



> Garbunkel,
> Does this information start you on the right track?
[quoted text clipped - 37 lines]
> > Any assistance that anyone can offer on how to overcome this is greatly
> > appreciated!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.