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
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