Add text to subject box

  • Thread starter Thread starter graeme
  • Start date Start date
G

graeme

Does anyone know how to create a macro or script to add
set text to the subject box and link to a button on the
toolbar.
 
This is all you need to set the subject line of an open e-mail message:

Dim objMsg As Outlook.MailItem
Set objMsg = Outlook.ActiveInspector.CurrentItem
objMsg.Subject = "TEST"

However, you can't put an HTML link in the message body that controls a
specific menu button in any of the toolbars.
 
Mr. Legault is correct if you're entering a line of *new* text for
the subject line. As I read your question, you're trying to "add"
fixed text (perhaps a keyword or internal distribution code) to what's
already in the subject line, and you want to do that by hitting a
button on the toolbar while reading the message? I went through
somehthing like that myself recently.

To *add* set text to what is already displayed in the subject line
(and keep that intact) try using a concantenation operation (&) to
modify the value represented by the objMsg.Subject object, something
along the lines:

objMsg.Subject = "Prepended text here " & objMsg.Subject

or

objMsg.Subject = objMsg.Subject & "Appended text here"


Once you save the complaete VBA macro, depending on OL version you can
create a button to fire the macro. Refer to
http://www.slipstick.com/outlook/toolbar.htm

/Sam/
(No MVP title - still stuggling with my own projects....)
 
Back
Top