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 / Long Documents / November 2003

Tip: Looking for answers? Try searching our database.

Parsing By Paragraph

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andrew Tegenkamp - 26 Nov 2003 21:29 GMT
I have an access database with a bunch of records and one field is a
paragraph. I can easily get that field into a VBA variable and place
it in their word template, but the client wants to be able to display
different paragraphs in the same variable/field to different locations
in a Word Doc.

Is there any way to parse out the different paragraphs? I have been
trying to base it on vbCr or vbLf but it's not very consistent. I know
about the paragraphs object (a little bit ~ mostly theory) but haven't
used it before so I'm not sure if I should go down that road in this
case.

Example:

strField = "Paragraph1!!Paragraph2!!Paragraph3!!Paragraph4" where ! is
a line return inside a single access field.

Thanks for any ideas,
Andrew
Cindy M  -WordMVP- - 28 Nov 2003 14:11 GMT
Hi Andrew,

I'm afraid you have no choice than to use what ever character
combination has been entered in the Access field to separate the
paragraphs. As I recall, Access uses either Chr$(10)&Chr$(13) or the
other way around (13, then 10). Either way, Word doesn't usually
interpret this correctly, and you'd need to replace them with vbCR or
remove them completely.

To split something like this up, one usually uses the InStr method to
find the location of a specific character, then Mid to break it out of
the string.

> I have an access database with a bunch of records and one field is a
> paragraph. I can easily get that field into a VBA variable and place
[quoted text clipped - 12 lines]
> strField = "Paragraph1!!Paragraph2!!Paragraph3!!Paragraph4" where ! is
> a line return inside a single access field.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)

Rate this thread:






 
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.