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 / February 2008

Tip: Looking for answers? Try searching our database.

Code in document to place bookmarked data in Outlook subject line

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
A_Classic_Man - 23 Feb 2008 15:24 GMT
I have a Word document that has bookmark fields. I would like data
from some of the bookmarks to show in the subject line when I email
the document. We are using Office 97. Can this be done with code in
the Word document or is it done in Outlook?

Thanks in advance
Ron
Doug Robbins - Word MVP - 23 Feb 2008 23:01 GMT
It can be done with code in Word once you have a reference in the Visual
Basic Editor to the appropriate Outlook Object Model.

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

http://www.word.mvps.org/FAQs/InterDev/SendMail.htm

in the code in the second method in that article, you would replace the line

.Subject = "New subject"

with

.Subject = "sometext" &
ActiveDocument.Bookmarks("nameofbookmarktobeinsertedinsubject").Range.Text &
"somemoretextifnecessary"

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

>I have a Word document that has bookmark fields. I would like data
> from some of the bookmarks to show in the subject line when I email
[quoted text clipped - 3 lines]
> Thanks in advance
> Ron
 
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.