Saving form file named by a field

T

Tellu

I have a protected form which should be saved automatically and the name of
the file should be the data of certain field user has entered. I tried with a
macro using bookmark and copying it and pasting it to the file name box. The
first problem is that the file is protected - I don´t know how to unprotect
it (Visual Basic is needed I suppose). After saving the file should be mailed
to a certain person. Is this possible automatically? (Almoust everything is
possible if you know how to do it...)
 
D

Doug Robbins - Word MVP

Run the following code on exit from the formfield that contains the name
that is to be used for the file

With ActiveDocument
.SaveAs .Formfields("formfieldname").Result
End With

--
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
 
T

Tellu

Doug,

Your code works, thanks! I managed to insert the folder to save to and the
file format (original file is template, the saved one a doc).

I put also this command button to the document:

Private Sub CommandButton1_Click()

ActiveDocument.SendMail

End Sub

I know there's a way to tell to whom this mail sould be send? Would you
pelase help me?

--
Thanks a lot!

Tellu


"Doug Robbins - Word MVP" kirjoitti:
Run the following code on exit from the formfield that contains the name
that is to be used for the file

With ActiveDocument
.SaveAs .Formfields("formfieldname").Result
End With

--
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
 
D

Doug Robbins - Word MVP

See the article "How to send an email from Word using VBA" at:

http://www.word.mvps.org/FAQs/InterDev/SendMail.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

Tellu said:
Doug,

Your code works, thanks! I managed to insert the folder to save to and the
file format (original file is template, the saved one a doc).

I put also this command button to the document:

Private Sub CommandButton1_Click()

ActiveDocument.SendMail

End Sub

I know there's a way to tell to whom this mail sould be send? Would you
pelase help me?

--
Thanks a lot!

Tellu


"Doug Robbins - Word MVP" kirjoitti:
 
T

Tellu

The code in the article works, but I have to click four times "yes" to the
question of allowing - I think it's too much. Additionaly the subject should
be the name of the file and the recipient doesn't have to send it back (the
automatic body). I suppose it is easier to use my simple macro and put
everyone select the recipient themselves.

However thanks for your help!

By the way, can you help me with my digital signature problem (another
question in the community)?
--
Thanks a lot!

Tellu


"Doug Robbins - Word MVP" kirjoitti:
 
D

Doug Robbins - Word MVP

To avoid having to to the Yes clicks, see information about the Express
Click Yes utility in the article "Mail Merge to E-mail with Attachments" at:

http://word.mvps.org/FAQs/MailMerge/MergeWithAttachments.htm

In that article, you will also see how to incorporate text into the subject
line of the email message.

I don't do digital signatures. Sorry.

--
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
 
T

Tellu

I'm a simple human being... (and I should manipulate several computers)
Thank's anyway for you help!
--
Thanks a lot!

Tellu


"Doug Robbins - Word MVP" kirjoitti:
 

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