Including field value from Word form in email subject/body

A

aprilheeler

I have a macro on a Word form (a document that's created from a
template, not a UserForm) that opens Outlook and addresses an email to
a particular person when you click a "notify" button. I'd like to
specify the value of a text field on the form as the subject of the
email. For example, if the text field says "JOE SMITH" I want the
email subject to be "JOE SMITH".

How do I specify that in the ".Subject = " line of code?

Also, the form, when the document is saved, inserts a footer that
specifies the location of the file and its name; is it possible to
specify that file path in the ".Body = " line?
 
A

aprilheeler

I have a macro on a Word form (a document that's created from a
template, not a UserForm) that opens Outlook and addresses an email to
a particular person when you click a "notify" button. I'd like to
specify the value of a text field on the form as the subject of the
email. For example, if the text field says "JOE SMITH" I want the
email subject to be "JOE SMITH".

How do I specify that in the ".Subject = " line of code?

Also, the form, when the document is saved, inserts a footer that
specifies the location of the file and its name; is it possible to
specify that file path in the ".Body = " line?

Ah...ActiveDocument.FormFields("bookmark").Result is what I'm looking
for, at least for the text field reference.
 

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