Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2006

Tip: Looking for answers? Try searching our database.

Microsoft Word Form: Save Form, Not Controls or Macros

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Reggie - 01 Nov 2006 02:27 GMT
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?
Doug Robbins - Word MVP - 01 Nov 2006 06:43 GMT
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

Signature

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

> Hello,
> I have a Word template that consists of a 2 pages worth of form fields,
[quoted text clipped - 8 lines]
> question is how do I save the document without the VBA code being
> included in the resulting file?
Reggie - 02 Nov 2006 02:20 GMT
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?

> 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
[quoted text clipped - 25 lines]
> > question is how do I save the document without the VBA code being
> > included in the resulting file?
Jay Freedman - 02 Nov 2006 04:40 GMT
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.

>I followed the Userform example, and I've changed to using a template
>file.  However, I'm still getting the "Macros, anybody?" dialog when
[quoted text clipped - 31 lines]
>> > question is how do I save the document without the VBA code being
>> > included in the resulting file?
Reggie - 02 Nov 2006 15:13 GMT
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"?

> Does your form include controls from the Control Toolbox? If so, those
> are the culprit.
[quoted text clipped - 44 lines]
> >> > question is how do I save the document without the VBA code being
> >> > included in the resulting file?
Jay Freedman - 02 Nov 2006 17:50 GMT
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".

Signature

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.

> 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
[quoted text clipped - 58 lines]
>>>>> open.  So, my question is how do I save the document without the
>>>>> VBA code being included in the resulting file?
Reggie - 02 Nov 2006 23:42 GMT
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.

> 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
[quoted text clipped - 71 lines]
> >>>>> open.  So, my question is how do I save the document without the
> >>>>> VBA code being included in the resulting file?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.