Resolved: Outlook Send button greyed out in attachments created by Word VBA

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
 
D

dedawson

Thanks Phil,

I don't have any particular need for this solution; but I applaud you
for your spirit of community. Proactive sharing of knowledge helps us
all.

david
 

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