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 / November 2004

Tip: Looking for answers? Try searching our database.

MergeFields Count (TextBox)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Craig Jones - 03 Nov 2004 22:24 GMT
Hi,
I have a macro that searches through a document for MergeFields, storing the
fieldnames in an array.  I first switch on fieldcodes view, and view page
header/footer before searching - this seems to work fine.

My problem is that when textboxes have MergeFields in them, they are not
found.  Even when I use the command:
ActiveDocument.MailMerge.Fields.Count it doesn't include them.

Any help would be greatly appreciated.

Regards
Cindy M  -WordMVP- - 04 Nov 2004 12:00 GMT
Hi Craig,

The problem is that text boxes are located in the "Drawing layer" of the
document, and much of Word's built-in functionality doesn't recognize anything
in this layer.

Best would probably be to convert the text boxes into Frames (Textbox tab of
the Format text box dialog box).

If you can't do this for some reason (linked text boxes, for example) then
you'll need to look at the articles on using Find on the word.mvps.org
website. When using a macro to "Find", you need to loop through the relevant
document "stories".

> I have a macro that searches through a document for MergeFields, storing the
> fieldnames in an array.  I first switch on fieldcodes view, and view page
[quoted text clipped - 3 lines]
> found.  Even when I use the command:
> ActiveDocument.MailMerge.Fields.Count it doesn't include them.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
Craig Jones - 07 Nov 2004 15:04 GMT
Thank you very much for your help Cindy, StoryRanges has indeed done the
trick.

Regards

Craig

> Hi Craig,
>
[quoted text clipped - 25 lines]
> This reply is posted in the Newsgroup; please post any follow question or
> reply in the newsgroup and not by e-mail :-)
 
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.