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 / Mailmerge and Fax / September 2006

Tip: Looking for answers? Try searching our database.

creating numbered lists from datasource

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bosconian - 05 Sep 2006 00:10 GMT
This seems like it should be easy, but I can't seem to find the answer.

I need to create a numbered list in Word from a datasource containing a
dynamic number of rows.

For example:

1. Paragraph text #1

2. Paragraph text #2

3. Paragraph text #3

How do you loop through a recordset using the same merge fields?

I've tried

{ MERGEFIELD ParagraphText }{ Next Record }

but this will only output the first record. I need a 'goto' type function to
loop through all the records.

Thanks in advance.
Bosconian - 05 Sep 2006 01:56 GMT
> This seems like it should be easy, but I can't seem to find the answer.
>
[quoted text clipped - 19 lines]
>
> Thanks in advance.

After some additional investigating, I have concluded that Word (2K) doesn't
have a built-in way to loop through a record set using the same merge field.
So you'll need to hardcode the maximum number of items your template is
expected to include.

So, the easiest way to accomplish this is by doing something like the
following:

{ IF {MERGEFIELD questiontext } <> "" "{MERGEFIELD questiontext }" ""}{
NEXT }

If you want each item numbered, simply highlight the merge field (the output
portion, not the condition) and choose your preferred number format via
Format->Bullets and Numbering. In this case the merge data display should
look like this:

{ IF {MERGEFIELD questiontext } <> "" "{MERGEFIELD questiontext }
1.    " ""}{ NEXT }
{ IF {MERGEFIELD questiontext } <> "" "{MERGEFIELD questiontext }
2.    " ""}{ NEXT }
{ IF {MERGEFIELD questiontext } <> "" "{MERGEFIELD questiontext }
3.    " ""}{ NEXT }
{ IF {MERGEFIELD questiontext } <> "" "{MERGEFIELD questiontext }
4.    " ""}{ NEXT }
{ IF {MERGEFIELD questiontext } <> "" "{MERGEFIELD questiontext }
5.    " ""}{ NEXT }

Note the line break placement, which will be included in the output.

Happy merging.
Doug Robbins - Word MVP - 05 Sep 2006 04:35 GMT
You should use a catalog or directory type mailmerge main document.
However, I suspect that you are probably trying to perform a "multiple items
per condition (=key field)" mailmerge which Word does not really have the
ability to do:

See the "Group Multiple items for a single condition" item on fellow MVP
Cindy Meister's website at

http://homepage.swissonline.ch/cindymeister/mergfaq1.htm#DBPic

Or take a look at the following Knowledge Base Article

http://support.microsoft.com/default.aspx?scid=kb;en-us;211303

http://www.knowhow.com/Guides/CompoundMerges/CompoundMerge.htm

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> This seems like it should be easy, but I can't seem to find the answer.
>
[quoted text clipped - 19 lines]
>
> Thanks in advance.
 
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.