Mail Merge and protection

H

Hameed

Hi,

I have a mail merge document in MS Word 2003 in which I use several form
fields to be filled manually as well.

When a user opens the document (well, the system generates the document),
they have to enable macros for the merge to work, once the data is retrieved
from external source and the document is merged, then I use VBA to set the
protection:

ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True,
Password:="My_PassWord"

Now the problem is that after this, the users are not able to edit the form
fields, although I have used wdAllowOnlyFormFields.
 
G

Graham Mayor

Form fields and mail merge are incompatible and the fields will will not
survive a merge. You will have to think of some other way of inserting your
data eg ASK fields?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
M

macropod

Hi Graham,

Assuming the ASK field and any cross-references to it survives the merge, I can see all sorts of problems arising with the
cross-references trying to get data from multiple instances of ASK fields that all set the same bookmark. Invariably, they'll all
end up pointing to the last ASK field.

Perhaps a user form would be better suited - especially since the OP is already using vba.

Cheers
 
G

Graham Mayor

Agreed - I don't like ASK fields at all. It was merely the first thing that
came out as a possible alternative - and then only if the same data applied
to all the records.. Nor do I like the idea of adding data per record on the
fly - much better to modify the data source.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
H

Hameed

Hi macropod,

Thanks for the reply.

Can you elaborate on using user forms?

Regards,
Hameed

macropod said:
Hi Graham,

Assuming the ASK field and any cross-references to it survives the merge, I can see all sorts of problems arising with the
cross-references trying to get data from multiple instances of ASK fields that all set the same bookmark. Invariably, they'll all
end up pointing to the last ASK field.

Perhaps a user form would be better suited - especially since the OP is already using vba.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Graham Mayor said:
Form fields and mail merge are incompatible and the fields will will not survive a merge. You will have to think of some other way
of inserting your data eg ASK fields?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
M

macropod

Hi Hameed,

See:
http://word.mvps.org/FAQs/Userforms/index.htm

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Hameed said:
Hi macropod,

Thanks for the reply.

Can you elaborate on using user forms?

Regards,
Hameed

macropod said:
Hi Graham,

Assuming the ASK field and any cross-references to it survives the merge, I can see all sorts of problems arising with the
cross-references trying to get data from multiple instances of ASK fields that all set the same bookmark. Invariably, they'll all
end up pointing to the last ASK field.

Perhaps a user form would be better suited - especially since the OP is already using vba.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Graham Mayor said:
Form fields and mail merge are incompatible and the fields will will not survive a merge. You will have to think of some other
way
of inserting your data eg ASK fields?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Hameed wrote:
Hi,

I have a mail merge document in MS Word 2003 in which I use several
form fields to be filled manually as well.

When a user opens the document (well, the system generates the
document), they have to enable macros for the merge to work, once the
data is retrieved from external source and the document is merged,
then I use VBA to set the protection:

ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True,
Password:="My_PassWord"

Now the problem is that after this, the users are not able to edit
the form fields, although I have used wdAllowOnlyFormFields.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top