How to print and at the same time save a WORD fill-in form.

L

lois

Hope someone in this group can help me.
I have created a fill-in form for my home business, and would like to
have MS Word 2000 automatically save a copy of the form to a pre
designated file on my computer when fill-in data is completed, and at
the same time print out a copy to the client for their signature. I
am totally new to layout techniques, and feel proud that I was able to
design and create such a document. It would therefore be an asset to
me if there is some way I can have MS WORD save each completed form so
that I have an archive both on my hard drive and on paper before it
prints it out, as the data on each client is different, I don't want
to have to remember to manually save before I print.

Hope my wish is possible. Please help
Thanks in advance
Lois
 
D

Doug Robbins

As the data for each client is different, you are going to have to come up
with a filename with which to save the document. That could perhaps be the
clients name and the date, so assuming that you have a textbox formfield
which has the bookmark name of client, into which the client's name is
entered, you could have a macro run when the last formfield has been filled
in (i.e. run on exit from that formfield)

ActiveDocument.SaveAs ActiveDocument.FormFields("client").Result &
format(Date, "yyyyMMdd")
ActiveDocument.PrintOut

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
D

Doug Robbins

Also see:

Please Fill Out This Form
Part 1: Create professional looking forms in Word
http://www.computorcompanion.com/LPMArticle.asp?ID=22

Part 2: Adding Automation to your Word forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=46

Part 3: Learn more VBA (macros) to automate your forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=119

Part 4: Use custom dialog boxes in your Word forms
http://www.computorcompanion.com/LPMArticle.asp?ID=127

Part 5: Connect your AutoForm to a database to save input time and keep
better records!
http://www.computorcompanion.com/LPMArticle.asp?ID=136


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
L

lois

Hi Doug,
Thanks for your prompt answer, and sorry for not replying sooner. I
had to make an unexpectdd trip. Never-the-less, I've been trying your
suggested code, but can't seem to get it to work as I'd hoped. It's
printing out ok, but I can't seem to get it to save. Don't know where
they are disappearing to.

Is it possible to send you a copy of my form via e-mail ?, maybe in
this way you can see how the fields are set up and come with a
suggestion of how the code should be created. I need it to be saved by
each individal client's name to a folder on my c:\drive which I named
Client Contracts. In that way it would be easier for me to track a
client.
I'm asking, as I wouldn't like to post it here for the world to see.
Hope you are still willing to assist me in my quest.

Thanks a whole bunch beforehand
Kind regards
 
D

Doug Robbins

To save the file in the C:\Client Contracts folder, use the following code:

ActiveDocument.SaveAs "C:\Client Contracts\" &
ActiveDocument.FormFields("client").Result &
format(Date, "yyyyMMdd")

Note that all needs to be on the one line in the visual basic editor.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
L

lois

Hi Doug,
Many thanks for your reply. I tried your last code out and Voila !, it
worked perfect.
I want to thank you for your kindness and patience with my question.
Great job
Kindest regards, and have a wonderful Labor Day weekend.
Lois
 
Top