P
PPL
Objective:
To use Word VBA to prepare a standard email which is then attached to a
covering email (sent to manager for approval).
Manager opens attachment, edits it & send it to list of recipients.
Problem:
If MS Word 2003 is used as Outlook 2003 default editor, then the attached
email cannot be sent to recipients because the Send button is greyed out!
'Code (with problem) to create detailed email
....
....
Set objmail = objol.CreateItem(0)
With objmail
..Subject = "Service Outage "
..To = DistributionList
..Importance = EmailImportance
..BodyFormat = olFormatHTML
..HTMLBody = "Stuff" ' taken from fields displayed in an earlier form
..SaveAs "U:\!ToServiceDeskMessage.msg ' Save message so that it can be
attached to covering email *PROBLEM 1 HERE*
....
....
Code to create covering email with attached (detailed) email saved above
With objmail
..Subject = "Service Outage"
..To = Approver
..CC = EndorsersListEmail
..Attachments.Add "U:\!ToServiceDeskMessage.msg" *PROBLEM 2 HERE*
..Body = MessageToApproverTextBox
..Display
End With
....
.....
Resolution:
Replace the .msg format with the .oft format. So
PROBLEM 1 line is fixed using
..SaveAs "U:\!ToServiceDeskMessage.oft", olTemplate
PROBLEM 2 line is fixed using
..Attachments.Add "U:\!ToServiceDeskMessage.oft
I am posting this becasue I spent days figuring it out & finally stumbled on
it.
I get so much good stuff from these NGs - hopefully someone else can benefit
from my accidental discovery!
Phil
To use Word VBA to prepare a standard email which is then attached to a
covering email (sent to manager for approval).
Manager opens attachment, edits it & send it to list of recipients.
Problem:
If MS Word 2003 is used as Outlook 2003 default editor, then the attached
email cannot be sent to recipients because the Send button is greyed out!
'Code (with problem) to create detailed email
....
....
Set objmail = objol.CreateItem(0)
With objmail
..Subject = "Service Outage "
..To = DistributionList
..Importance = EmailImportance
..BodyFormat = olFormatHTML
..HTMLBody = "Stuff" ' taken from fields displayed in an earlier form
..SaveAs "U:\!ToServiceDeskMessage.msg ' Save message so that it can be
attached to covering email *PROBLEM 1 HERE*
....
....
Code to create covering email with attached (detailed) email saved above
With objmail
..Subject = "Service Outage"
..To = Approver
..CC = EndorsersListEmail
..Attachments.Add "U:\!ToServiceDeskMessage.msg" *PROBLEM 2 HERE*
..Body = MessageToApproverTextBox
..Display
End With
....
.....
Resolution:
Replace the .msg format with the .oft format. So
PROBLEM 1 line is fixed using
..SaveAs "U:\!ToServiceDeskMessage.oft", olTemplate
PROBLEM 2 line is fixed using
..Attachments.Add "U:\!ToServiceDeskMessage.oft
I am posting this becasue I spent days figuring it out & finally stumbled on
it.
I get so much good stuff from these NGs - hopefully someone else can benefit
from my accidental discovery!
Phil