Macro code for a subject line button.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there,

I'm after maco code for a subject line button. When button is
clicked the subject displays my required subject.

Thanks in advanced.

Steve
 
Try this:

Sub MySubject()
Dim itm as Object
On Error Resume Next
Set itm = Application.ActiveInspector.CurrentItem
itm.Subject = "My Subject"
set itm = Nothing
End Sub

FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.outlook.program_vba

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Works a treat, thanks Sue. x

Sue Mosher said:
Try this:

Sub MySubject()
Dim itm as Object
On Error Resume Next
Set itm = Application.ActiveInspector.CurrentItem
itm.Subject = "My Subject"
set itm = Nothing
End Sub

FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.outlook.program_vba

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top