Group:  Microsoft Word ยป microsoft.public.word.mailmerge.fields
Thread: Listing the merge variables from all the dot documents

Geek News

Listing the merge variables from all the dot documents
PRaveen 6/4/2007 6:09:02 PM
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
Re: Listing the merge variables from all the dot documents
"Peter Jamieson" <pjj[ at ]KillmapSpjjnet.demon.co.uk> 6/5/2007 9:15:49 AM
[Quoted Text]
> 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" <PRaveen[ at ]discussions.microsoft.com> wrote in message
news:0BF75660-A900-43B0-9390-782BB563213D[ at ]microsoft.com...
> 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

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net