Macro code for a subject line button.

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
 
S

Sue Mosher [MVP-Outlook]

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
 
G

Guest

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
 

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