How to set the order of attachments in outlook message

U

upendra

Hi I am Adding two attachments to a mail message programatically. I am
facing a challenge that Outlook is considering my 2nd Attachment as
the 1st attachment and 1st attachment as 2nd.

Is there a way where I can set the order of attachments in Outlook
VBA.

Below is the code that I am using. Kindly throw some light on this.


Set oOutlookApp = GetObject(, "Outlook.Application")

If Err <> 0 Then
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If


Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem
.To = faxnum
.CC = "(e-mail address removed)"
.Subject = "Test from Tool"
' 1st Attachment
.Attachments.Add TextBox3.Text, olByValue, 1, "Covering Letter"
' 2nd Attachment
.Attachments.Add Source:=ActiveDocument.FullName,
Type:=olByValue,DisplayName:=ActiveDocument.Name
.Save
.Display
End With

If bStarted Then
oOutlookApp.Quit
End If
Set oItem = Nothing
Set oOutlookApp = Nothing

Upendra
 
K

Ken Slovak - [MVP - Outlook]

In RTF messages you can control the placement of the attachments. Otherwise
you can't control that at all.
 

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