View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Listing the merge variables from all the dot documents

Secondly the variables are marked {{home_address1}}

Your "fields" look non-standard.

A standard Merge field would look like { MERGEFIELD home_address1 }, and a
local REF field would look like { REF home_address1 } or { home_address1 },
with the {} being the special field braces you can insert using ctrl-F9.

So are your "fields" just pieces of text that are processed by some existing
program? Do they start with two /ordinary/ {{ characters and end with two
ordinary }} characters?

Either way, you could start by adapting the macro at
http://word.mvps.org/FAQs/MacrosVBA/BatchFR.htm, but to look through every
part of a document (main body, headers, footers etc.) in the middle of that
you need a loop that does...

Dim objRange as Word.Range
For each objRange in ActiveDocument.StoryRanges
Do
' whatever it is that you need to do
Set objRange = objRange.NextStoryRange
Loop until objRange is Nothing
Next

(Although you would need more than that to detect fields and text contained
in objects such as text boxes, other shapes, and frames).

Peter Jamieson
"PRaveen" wrote in message
...
Hi...All,

I am a newbie to the Word Merge.
I have close to 250 .dot documents & I have to find out all the variables
that are used in these documents to do the merge. It will take time for
me
to open each one of them & find the variables (and I might miss some too).

Which is the easiest way to process the documents & list the variables.
Secondly the variables are marked {{home_address1}}

Regards,

Praveen