Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Drew Drew is offline
external usenet poster
 
Posts: 4
Default Replacing text with Merge Fields in Word

I am attempting to convert a plain text document that contains certain
variables as delimited by the "@" or other user specified delimiters
and I can't seem to get the merge fields to position themselves in the
proper location. What currently happens is that the variables are
successfully removed, but the merge fields are all placed at the end of
the document. Also, any merge fields that have more than one word in
the field name is truncated to only the first word of the field's name.
The code that I am using is below:

With objWord.Content.find
rsVariableDefinitions.MoveFirst
Do Until rsVariableDefinitions.EOF 'loop
through variable definition table and replace text with their merge
fields
.Execute strDelimiter &
rsVariableDefinitions!Variable & strDelimiter, , True, , , , True, , ,
"", True 'Delete the variable placeholder
If .Found Then
Let strField =
rsVariableDefinitions("Field")
objWord.MailMerge.Fields.Add
oSel.Range, strField
End If
rsVariableDefinitions.MoveNext
Loop
End With

Can any one please help!

Thanks, Drew

 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting WordPerfect 12 files to Word 2003 Curious New Users 4 May 19th 23 02:48 PM
Why dont MS just f**king re-write Word from scratch? Its dogsh*t Word Hater Microsoft Word Help 33 May 5th 23 02:52 PM
take yet another lesson from wordperfect "reveal codes" wordperfect is superior Microsoft Word Help 5 May 11th 09 07:58 PM
WP merge file to Word sstires Tables 4 February 14th 06 06:26 PM
merge instructions from text file Steve Mailmerge 8 November 26th 05 03:31 AM


All times are GMT +1. The time now is 06:50 AM.

Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"