 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Phil Barber Guest
|
Posted: Fri Jan 23, 2004 4:34 pm Post subject: Word Merg fields |
|
|
I created a word document and placed a mergeField in it named FNAME
Given the below Code
WordApp := CreateOleObject('Word.application');
WordApp.visible := true;
wordDoc := wordApp.Documents.open('D:Name.doc');
WordDoc.Fields.item(1).result.text := 'Phil';
I can load the FNAME Mergfield with 'Phil' but how do I reference the
Mergfield by Name instead of number (1) ?
Thanks
Phil
|
|
| Back to top |
|
 |
Oliver Townshend Guest
|
Posted: Sat Jan 24, 2004 5:34 am Post subject: Re: Word Merg fields |
|
|
"Phil Barber" <barber (AT) galtney (DOT) com> wrote
| Quote: | I created a word document and placed a mergeField in it named FNAME
Given the below Code
WordApp := CreateOleObject('Word.application');
WordApp.visible := true;
wordDoc := wordApp.Documents.open('D:Name.doc');
WordDoc.Fields.item(1).result.text := 'Phil';
I can load the FNAME Mergfield with 'Phil' but how do I reference the
Mergfield by Name instead of number (1) ?
|
Insert a bookmark around the field might work, as then you could find the
field within the Bookmark range. If you are just using the field codes to
insert text, rather than actually doing a merge, then it might be simpler to
use Bookmarks, or to use the Forms toolbar to insert FormText fields.
Oliver Townshend
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|