We help IT Professionals succeed at work.

Form/Macro to create new message in outlook with prefilled subject line

MrBabbage
MrBabbage asked
on
Medium Priority
1,598 Views
Last Modified: 2012-05-07
I am looking to create a macro of form which can be published to a group of users.  It would need to have 3 buttons which would create a new message with a prefilled subject line.

I.E

Button 1 creates a new blank message with the subject line <tag1>
Button 2 creates a new blank message with the subject line <sub2>

etc etc.

Is this possible?

Comment
Watch Question

Author

Commented:
I have created Macros and a custom toolbar which works but I would like to publish a form to the Organizational Library so I can simply choose this form rather then manually making a macro and custom toolbar for each user.

Sub NewMail1()
Dim objOLApp As Outlook.Application
Dim NewMail As Outlook.MailItem
Set objOLApp = New Outlook.Application
Set NewMail = objOLApp.CreateItem(olMailItem)
NewMail.Subject = "<test>"
NewMail.Display
End Sub
CERTIFIED EXPERT

Commented:
The only way I know how to make this "publishable" to multiple users is to replace their  .OTM file (the file where all macros are save for Outlook) this would mean anything already there would be deleted.

The second is to create a Outlook Add-in.  To make this as simply as possible this would be a COM .dll.  You can do it in .NET as well.  Are you able (meaning will the computers accept) to distribute a .dll and register it on these people computers?  If yes then we could do a COM Add-in adding your own Outlook macro that you have developed.

Author

Commented:
Yes I have administrative rights on the computers so distributing and registering a .dll will not be a problem.

Author

Commented:
Sub New_Mail_Southend()
Dim objOLApp As Outlook.Application
Dim NewMail As Outlook.MailItem
Set objOLApp = New Outlook.Application
Set NewMail = objOLApp.CreateItem(olMailItem)
NewMail.Subject = "<ins lhd>"
NewMail.Display
End Sub

Sub New_Mail_High_Wycombe()
Dim objOLApp As Outlook.Application
Dim NewMail As Outlook.MailItem
Set objOLApp = New Outlook.Application
Set NewMail = objOLApp.CreateItem(olMailItem)
NewMail.Subject = "<ins cri-hw>"
NewMail.Display
End Sub

Ideally the above would be launchable from a toolbar with two buttons in outlook.
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.