View Single Post
  #1  
Old April 8th, 2010, 10:12 AM posted to microsoft.public.word.mailmerge.fields
Andy Roberts
external usenet poster
 
Posts: 183
Default Mail Merge & Protected Form (Doug Robbins Code)

I was pointed to Doug Robbins code at
(http://www.gmayor.com/Form_Fields_and_Mail_Merge.htm) which looks to do
exactly what I need however I'm getting an error when the macro runs which
is a 9 Subscript out of range error (see attached screenshot).

The scenario is that I have a form with quite a few tick boxes and text
fields in it but I want to populate the form title and address of the
recipient similar to Doug's Example. Once populated I then want to protect
the form and tick the relevant check boxes before printing etc (again
similar to Doug's example).

I have saved the form as a macro enabled word template, with an attached
data source and relevant mail merge fields in the correct places, plus my
checkboxes (the form is unprotected at this point as I can see the mail
merge results and word 2007 wont let you protect a form if it contains any
mail merge fields).

I then open a new document based on this template and manually run Doug's
code which prompts me for a password which I click OK for (and leave blank
as I don't need one). A couple of seconds later I get the subscript error
with no break in the code so I can't see where it is failing.

If I click ok to the error message and examine the document it seems to be
ok? Should I be seeing this error?

--
Regards

Andy

Andy Roberts
Win XP, Office 2007