Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Hide/Show Sections of a Mail Merge Doc.

1,459 views
Skip to first unread message

Sathiya Rajagopal

unread,
Jan 23, 2002, 2:59:00 PM1/23/02
to
Is it possible to conditionally Hide/Show different section
of a word document with mail merge fields ?

Also is it possible to conditionally Protect/unprotect
different section of mail merge document.

I need to do this as part of mail merge automation.

Thanks in advance.

Regards,

Sathiya

Peter Jamieson

unread,
Jan 24, 2002, 4:09:34 AM1/24/02
to
> Is it possible to conditionally Hide/Show different section
> of a word document with mail merge fields ?

The only way to do "conditional text" is to put the whole section you want
inside an IF field. (Or you can try putting it in a separate document and
using a combination of IF and INCLUDETEXT fields, or there are other
approaches). But if you actually mean "Word Sections" rather than just
"chunks of text", I think you will be pushing Word quite hard. For example,
evaluating an IF field can change a continuous section break inside it into
a next page section break, which makes it hard to achieve stability

> Also is it possible to conditionally Protect/unprotect
> different section of mail merge document.

No.

If these are the sorts of thing you need to do, you can consider generating
a file using a mailmerge process, then "patching it up" using VBA. But I
think it would probably be easier to consider generating the entire output
document using Automation, possibly starting with your own "template".

Peter Jamieson
MS Word MVP

"Sathiya Rajagopal" <sath...@yahoo.com> wrote in message
news:d3bb01c1a448$66161b90$b1e62ecf@tkmsftngxa04...

Sathiya Rajagopal

unread,
Jan 24, 2002, 2:13:19 PM1/24/02
to
Thanks Peter.

Follow up questions based on your response...

I understand

"generating the entire output document using Automation"

Can you explain little bit more on

"possibly starting with your own "template" "

Regards,

Sathiya

>.
>

Peter Jamieson

unread,
Jan 24, 2002, 5:21:14 PM1/24/02
to
> "possibly starting with your own "template" "

I mean that if you have text with formatting and layout, it is sometimes
easiest to create it using Word, save it, and copy/paste it using VBA rather
than working out how to generte /exactly/ that layout in VBA. In other
words, it's a rich text resource that your VBA code uses to do its work.Your
VBA code can be much more general-purpose, since, for example, authorised
users can make minor changes to the Word text and the VBA would typically
still work. Further, you can put "placeholders" in the text - in fact there
is no reason not to use the same sorts of field codes that Word mailmerge
uses - that your VBA can find and fill in. You just need to identify a good
balance between generalising and getting the design and programming job
done.

So I have put quotes around "template" to indicate that I do not mean a Word
.dot file, just a template in the general sense of the Word.

Peter Jamieson
MS Word MVP

"Sathiya Rajagopal" <sath...@yahoo.com> wrote in message

news:f37801c1a50b$2f219d80$9be62ecf@tkmsftngxa03...

Sathiya Rajagopal

unread,
Feb 4, 2002, 10:13:51 PM2/4/02
to
Thanks so much Peter. This is exactly I we wanted to do.
I wonder, you could point me to some sample (VBA)code that
does some think similar to this.

Appreciate your help.


Thanks again

-Sathiya

>..dot file, just a template in the general sense of the

>.
>

0 new messages