G
Guest
Outlook 2003
I have found and edited the following code (sourced from Sue Mosher) and
assigned it to a button on a customised tool bar but would prefer to have
this run when I click on the 'new mail message' button on the standard tool
bar. Is this possible?
Sub CreateNewMail()
'Creates a new e-mail item
Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem
Dim strEmail As String
'Set Application
Set olApp = Outlook.Application
'Set new email item
Set objMail = olApp.CreateItem(olMailItem)
'Ask user to record project number
strEmail = InputBox("Please enter Job Number or Client Name", _
"Job Number")
'Set Job Number in BC
objMail.CC = strEmail
'Display the email
objMail.Display
'Resolve project number to find project address
objMail.Recipients.ResolveAll
End Sub
Also the way I am using the 'resolve' does not seem to work. The project
address is not resolved until I hot the send button. This is no big issue
but I if someone could help I would prefer to check the project number and
find the correct address before I hit the send button.
Thanks
Carmi
I have found and edited the following code (sourced from Sue Mosher) and
assigned it to a button on a customised tool bar but would prefer to have
this run when I click on the 'new mail message' button on the standard tool
bar. Is this possible?
Sub CreateNewMail()
'Creates a new e-mail item
Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem
Dim strEmail As String
'Set Application
Set olApp = Outlook.Application
'Set new email item
Set objMail = olApp.CreateItem(olMailItem)
'Ask user to record project number
strEmail = InputBox("Please enter Job Number or Client Name", _
"Job Number")
'Set Job Number in BC
objMail.CC = strEmail
'Display the email
objMail.Display
'Resolve project number to find project address
objMail.Recipients.ResolveAll
End Sub
Also the way I am using the 'resolve' does not seem to work. The project
address is not resolved until I hot the send button. This is no big issue
but I if someone could help I would prefer to check the project number and
find the correct address before I hit the send button.
Thanks
Carmi