Hello,
I have a Word template that consists of a 2 pages worth of form fields,
and 1 page that has the controls used to fill in the form. The
arrangement works well enough, and allows the user to edit the form
manually if the source data is incorrect. I've even figured out how to
save the last 2 pages of the document to a file without the controls.

However, I'm having a problem saving the form without the VBA code
being included. I don't want my users getting confused by the "Macros
anybody?" dialog popping up everytime a completed form is open. So, my
question is how do I save the document without the VBA code being
included in the resulting file?

Re: Microsoft Word Form: Save Form, Not Controls or Macros by Doug

Doug
Tue Oct 31 23:43:34 CST 2006

Save the form as a template in their templates folder and then have them use
File>New and select that template as the basis of the document. Your page
with the controls should probably be a userform however, not a page in the
document

See the article "How to create a Userform" at:

http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Reggie" <reginald.johnson@gmail.com> wrote in message
news:1162344452.275521.58540@f16g2000cwb.googlegroups.com...
> Hello,
> I have a Word template that consists of a 2 pages worth of form fields,
> and 1 page that has the controls used to fill in the form. The
> arrangement works well enough, and allows the user to edit the form
> manually if the source data is incorrect. I've even figured out how to
> save the last 2 pages of the document to a file without the controls.
>
> However, I'm having a problem saving the form without the VBA code
> being included. I don't want my users getting confused by the "Macros
> anybody?" dialog popping up everytime a completed form is open. So, my
> question is how do I save the document without the VBA code being
> included in the resulting file?
>



Re: Microsoft Word Form: Save Form, Not Controls or Macros by Reggie

Reggie
Wed Nov 01 19:20:14 CST 2006

I followed the Userform example, and I've changed to using a template
file. However, I'm still getting the "Macros, anybody?" dialog when
opening a doc file saved after creating a new document from the
template. Is there a way to get rid of whatever code is in the
document so that I'm not getting this dialog?

Doug Robbins - Word MVP wrote:
> Save the form as a template in their templates folder and then have them use
> File>New and select that template as the basis of the document. Your page
> with the controls should probably be a userform however, not a page in the
> document
>
> See the article "How to create a Userform" at:
>
> http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
>
> --
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "Reggie" <reginald.johnson@gmail.com> wrote in message
> news:1162344452.275521.58540@f16g2000cwb.googlegroups.com...
> > Hello,
> > I have a Word template that consists of a 2 pages worth of form fields,
> > and 1 page that has the controls used to fill in the form. The
> > arrangement works well enough, and allows the user to edit the form
> > manually if the source data is incorrect. I've even figured out how to
> > save the last 2 pages of the document to a file without the controls.
> >
> > However, I'm having a problem saving the form without the VBA code
> > being included. I don't want my users getting confused by the "Macros
> > anybody?" dialog popping up everytime a completed form is open. So, my
> > question is how do I save the document without the VBA code being
> > included in the resulting file?
> >


Re: Microsoft Word Form: Save Form, Not Controls or Macros by Jay

Jay
Wed Nov 01 21:40:54 CST 2006

Does your form include controls from the Control Toolbox? If so, those
are the culprit.

When you save a document that's based on a macro-containing template,
the macros are _not_ saved in the document.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

On 1 Nov 2006 17:20:14 -0800, "Reggie" <reginald.johnson@gmail.com>
wrote:

>I followed the Userform example, and I've changed to using a template
>file. However, I'm still getting the "Macros, anybody?" dialog when
>opening a doc file saved after creating a new document from the
>template. Is there a way to get rid of whatever code is in the
>document so that I'm not getting this dialog?
>
>Doug Robbins - Word MVP wrote:
>> Save the form as a template in their templates folder and then have them use
>> File>New and select that template as the basis of the document. Your page
>> with the controls should probably be a userform however, not a page in the
>> document
>>
>> See the article "How to create a Userform" at:
>>
>> http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
>>
>> --
>> Hope this helps.
>>
>> Please reply to the newsgroup unless you wish to avail yourself of my
>> services on a paid consulting basis.
>>
>> Doug Robbins - Word MVP
>>
>> "Reggie" <reginald.johnson@gmail.com> wrote in message
>> news:1162344452.275521.58540@f16g2000cwb.googlegroups.com...
>> > Hello,
>> > I have a Word template that consists of a 2 pages worth of form fields,
>> > and 1 page that has the controls used to fill in the form. The
>> > arrangement works well enough, and allows the user to edit the form
>> > manually if the source data is incorrect. I've even figured out how to
>> > save the last 2 pages of the document to a file without the controls.
>> >
>> > However, I'm having a problem saving the form without the VBA code
>> > being included. I don't want my users getting confused by the "Macros
>> > anybody?" dialog popping up everytime a completed form is open. So, my
>> > question is how do I save the document without the VBA code being
>> > included in the resulting file?
>> >

Re: Microsoft Word Form: Save Form, Not Controls or Macros by Reggie

Reggie
Thu Nov 02 08:13:16 CST 2006

Understood, I tried it with a blank document without the form, and it
worked as you said it would. However, I am running into a different
problem with this project.

This form will operate in a multi-user environment so I want to save
the Template file to my company LAN. However, saving the template
anywhere outside the default folder prevents the code that
automatically opens the userform does not run. I can't save the
template in every user's default template folder.

How do I get the "document_new()" code to run when I save the template
outside of the default "template folder"?

Jay Freedman wrote:
> Does your form include controls from the Control Toolbox? If so, those
> are the culprit.
>
> When you save a document that's based on a macro-containing template,
> the macros are _not_ saved in the document.
>
> --
> Regards,
> Jay Freedman
> Microsoft Word MVP FAQ: http://word.mvps.org
> Email cannot be acknowledged; please post all follow-ups to the
> newsgroup so all may benefit.
>
> On 1 Nov 2006 17:20:14 -0800, "Reggie" <reginald.johnson@gmail.com>
> wrote:
>
> >I followed the Userform example, and I've changed to using a template
> >file. However, I'm still getting the "Macros, anybody?" dialog when
> >opening a doc file saved after creating a new document from the
> >template. Is there a way to get rid of whatever code is in the
> >document so that I'm not getting this dialog?
> >
> >Doug Robbins - Word MVP wrote:
> >> Save the form as a template in their templates folder and then have them use
> >> File>New and select that template as the basis of the document. Your page
> >> with the controls should probably be a userform however, not a page in the
> >> document
> >>
> >> See the article "How to create a Userform" at:
> >>
> >> http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
> >>
> >> --
> >> Hope this helps.
> >>
> >> Please reply to the newsgroup unless you wish to avail yourself of my
> >> services on a paid consulting basis.
> >>
> >> Doug Robbins - Word MVP
> >>
> >> "Reggie" <reginald.johnson@gmail.com> wrote in message
> >> news:1162344452.275521.58540@f16g2000cwb.googlegroups.com...
> >> > Hello,
> >> > I have a Word template that consists of a 2 pages worth of form fields,
> >> > and 1 page that has the controls used to fill in the form. The
> >> > arrangement works well enough, and allows the user to edit the form
> >> > manually if the source data is incorrect. I've even figured out how to
> >> > save the last 2 pages of the document to a file without the controls.
> >> >
> >> > However, I'm having a problem saving the form without the VBA code
> >> > being included. I don't want my users getting confused by the "Macros
> >> > anybody?" dialog popping up everytime a completed form is open. So, my
> >> > question is how do I save the document without the VBA code being
> >> > included in the resulting file?
> >> >


Re: Microsoft Word Form: Save Form, Not Controls or Macros by Jay

Jay
Thu Nov 02 10:50:00 CST 2006

Save the template in a folder on a public share. In Word, go to Tools >
Options > File Locations and set the Workgroup Templates location to point
to that folder. Each user will have to make the same setting. Each user
should also go to Tools > Macro > Security > Trusted Publishers and check
the box for "Trust all installed templates and add-ins".

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Reggie wrote:
> Understood, I tried it with a blank document without the form, and it
> worked as you said it would. However, I am running into a different
> problem with this project.
>
> This form will operate in a multi-user environment so I want to save
> the Template file to my company LAN. However, saving the template
> anywhere outside the default folder prevents the code that
> automatically opens the userform does not run. I can't save the
> template in every user's default template folder.
>
> How do I get the "document_new()" code to run when I save the template
> outside of the default "template folder"?
>
> Jay Freedman wrote:
>> Does your form include controls from the Control Toolbox? If so,
>> those are the culprit.
>>
>> When you save a document that's based on a macro-containing template,
>> the macros are _not_ saved in the document.
>>
>> --
>> Regards,
>> Jay Freedman
>> Microsoft Word MVP FAQ: http://word.mvps.org
>> Email cannot be acknowledged; please post all follow-ups to the
>> newsgroup so all may benefit.
>>
>> On 1 Nov 2006 17:20:14 -0800, "Reggie" <reginald.johnson@gmail.com>
>> wrote:
>>
>>> I followed the Userform example, and I've changed to using a
>>> template file. However, I'm still getting the "Macros, anybody?"
>>> dialog when opening a doc file saved after creating a new document
>>> from the template. Is there a way to get rid of whatever code is
>>> in the document so that I'm not getting this dialog?
>>>
>>> Doug Robbins - Word MVP wrote:
>>>> Save the form as a template in their templates folder and then
>>>> have them use File>New and select that template as the basis of
>>>> the document. Your page with the controls should probably be a
>>>> userform however, not a page in the document
>>>>
>>>> See the article "How to create a Userform" at:
>>>>
>>>> http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
>>>>
>>>> --
>>>> Hope this helps.
>>>>
>>>> Please reply to the newsgroup unless you wish to avail yourself of
>>>> my services on a paid consulting basis.
>>>>
>>>> Doug Robbins - Word MVP
>>>>
>>>> "Reggie" <reginald.johnson@gmail.com> wrote in message
>>>> news:1162344452.275521.58540@f16g2000cwb.googlegroups.com...
>>>>> Hello,
>>>>> I have a Word template that consists of a 2 pages worth of form
>>>>> fields, and 1 page that has the controls used to fill in the
>>>>> form. The arrangement works well enough, and allows the user to
>>>>> edit the form manually if the source data is incorrect. I've
>>>>> even figured out how to save the last 2 pages of the document to
>>>>> a file without the controls.
>>>>>
>>>>> However, I'm having a problem saving the form without the VBA code
>>>>> being included. I don't want my users getting confused by the
>>>>> "Macros anybody?" dialog popping up everytime a completed form is
>>>>> open. So, my question is how do I save the document without the
>>>>> VBA code being included in the resulting file?



Re: Microsoft Word Form: Save Form, Not Controls or Macros by Reggie

Reggie
Thu Nov 02 16:42:13 CST 2006

Thanks for your help Jay and Doug. I hope Microsoft is compensating
you guys well because you deserve it. I hope that the next version of
Office has a better way to do this. I don't like having to make (or
count on) my users doing set up work. So, why am I doing this in Word
you ask; I don't have a choice. the orginal form is in Word, and I'm
just trying to make my job easier. I'll stop whining now, and get to
work.


Jay Freedman wrote:
> Save the template in a folder on a public share. In Word, go to Tools >
> Options > File Locations and set the Workgroup Templates location to point
> to that folder. Each user will have to make the same setting. Each user
> should also go to Tools > Macro > Security > Trusted Publishers and check
> the box for "Trust all installed templates and add-ins".
>
> --
> Regards,
> Jay Freedman
> Microsoft Word MVP FAQ: http://word.mvps.org
> Email cannot be acknowledged; please post all follow-ups to the newsgroup so
> all may benefit.
>
> Reggie wrote:
> > Understood, I tried it with a blank document without the form, and it
> > worked as you said it would. However, I am running into a different
> > problem with this project.
> >
> > This form will operate in a multi-user environment so I want to save
> > the Template file to my company LAN. However, saving the template
> > anywhere outside the default folder prevents the code that
> > automatically opens the userform does not run. I can't save the
> > template in every user's default template folder.
> >
> > How do I get the "document_new()" code to run when I save the template
> > outside of the default "template folder"?
> >
> > Jay Freedman wrote:
> >> Does your form include controls from the Control Toolbox? If so,
> >> those are the culprit.
> >>
> >> When you save a document that's based on a macro-containing template,
> >> the macros are _not_ saved in the document.
> >>
> >> --
> >> Regards,
> >> Jay Freedman
> >> Microsoft Word MVP FAQ: http://word.mvps.org
> >> Email cannot be acknowledged; please post all follow-ups to the
> >> newsgroup so all may benefit.
> >>
> >> On 1 Nov 2006 17:20:14 -0800, "Reggie" <reginald.johnson@gmail.com>
> >> wrote:
> >>
> >>> I followed the Userform example, and I've changed to using a
> >>> template file. However, I'm still getting the "Macros, anybody?"
> >>> dialog when opening a doc file saved after creating a new document
> >>> from the template. Is there a way to get rid of whatever code is
> >>> in the document so that I'm not getting this dialog?
> >>>
> >>> Doug Robbins - Word MVP wrote:
> >>>> Save the form as a template in their templates folder and then
> >>>> have them use File>New and select that template as the basis of
> >>>> the document. Your page with the controls should probably be a
> >>>> userform however, not a page in the document
> >>>>
> >>>> See the article "How to create a Userform" at:
> >>>>
> >>>> http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
> >>>>
> >>>> --
> >>>> Hope this helps.
> >>>>
> >>>> Please reply to the newsgroup unless you wish to avail yourself of
> >>>> my services on a paid consulting basis.
> >>>>
> >>>> Doug Robbins - Word MVP
> >>>>
> >>>> "Reggie" <reginald.johnson@gmail.com> wrote in message
> >>>> news:1162344452.275521.58540@f16g2000cwb.googlegroups.com...
> >>>>> Hello,
> >>>>> I have a Word template that consists of a 2 pages worth of form
> >>>>> fields, and 1 page that has the controls used to fill in the
> >>>>> form. The arrangement works well enough, and allows the user to
> >>>>> edit the form manually if the source data is incorrect. I've
> >>>>> even figured out how to save the last 2 pages of the document to
> >>>>> a file without the controls.
> >>>>>
> >>>>> However, I'm having a problem saving the form without the VBA code
> >>>>> being included. I don't want my users getting confused by the
> >>>>> "Macros anybody?" dialog popping up everytime a completed form is
> >>>>> open. So, my question is how do I save the document without the
> >>>>> VBA code being included in the resulting file?