Setting body of email to Plain Text

pga

New Member
Joined
Jun 25, 2002
Messages
9
Hi all....I have an excel macro that is emailing a file with an excel workbook attached to it. It works fine except that it is sending the file as HTML and I need to send it as plain text. I am having trouble locating how to modify this....any help is appreciated. Thanks.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
The macro is from Excel VBA...here is the code:

Sub sendemail()


Set aOutlook = CreateObject("Outlook.Application")

Workbooks.Open Filename:="C:\ideas\Name File.xls"
Set DataName = Application.ActiveWorkbook
Workbooks(DataName.Name).Worksheets(1).Activate

PathName = "I:\Jobs\"


For I = 1 To 2

FullPath = PathName & Cells(I, 1) & ".xls"

Set aEmail = aOutlook.CreateItem(olmailitem)
aEmail.Importance = olImportanceHigh
aEmail.Subject = "This is a test...this is only a test"
aEmail.Body = "I am testing out sending one attachment to multiple people. Please respond to me if you received 2 reports. Thanks."
If Trim(Cells(I, 2)) <> "" Then
aEmail.Recipients.Add Cells(I, 2)
End If
If Trim(Cells(I, 3)) <> "" Then
aEmail.Recipients.Add Cells(I, 3)
End If
If Trim(Cells(I, 4)) <> "" Then
aEmail.Recipients.Add Cells(I, 4)
End If
If Trim(Cells(I, 5)) <> "" Then
aEmail.Recipients.Add Cells(I, 5)
End If
Set myAttachments = aEmail.Attachments
myAttachments.Add FullPath

aEmail.Send

Next I

End Sub


The email sends just fine with the attachment it just sends it as HTML instead of Plain Text
 
Upvote 0
Hmmmm....nope....does not seem to like that at all and i dont see a "BodyType" listed in any of my reference books.
 
Upvote 0
Actually, that DOES work if I am using Outlook 2002 (I was using 2000)...I had to upgrade to get the 10.0 Microsoft Outlook Reference Library....once I did that, that seemed to take care of it. Thank you.
 
Upvote 0
Oh, didn't know that 2000 worked different, I have 2002 installed here, so, I just assumed it would be the same ! anyway, glad you got it working.
 
Upvote 0

Forum statistics

Threads
1,215,880
Messages
6,127,519
Members
449,385
Latest member
KMGLarson

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top