Hi =?Utf-8?B?dHJvYg==?=,
Do NOT try to use mail merge fields (or, by choice, any fields) in a text box. Things in the Drawing Layer just aren't properly accessible to Word's internal functionality. You can get to them programmatically by accessing that document STORY (see STORYRANGES in the VBA Help), but...
If at all possible, use a FRAME (from the Forms toolbar) instead. That's visible to Word's internal functionality. You can convert existing text boxes to frames, using a button in Format/[graphic or whatever]/Textbox
[Quoted Text] > I'm using Word 2003 SP2 and have a single page document containing a variety > of text, as well as some mailmerge fields. > > I have recently added a few text boxes and within these text boxes I have > placed normal text and also mailmerge fields. > > I'm (eventually) doing a mailmerge via VB macros and the problem I have is > that when I iterate through the fields on the document, I'm only ever seeing > the mailmerge fields on the 'main' document, not those in the text boxes. > > I have played around using the following code to find out how many fields I > have; > > application.ActiveDocument.MailMerge.Fields.Count > > Again this reports only the fields which are NOT in text boxes. > > So my query is, how do I access the mailmerge fields in the text boxes? >
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 :-)
|