confusion123
Active Member
- Joined
- Jul 27, 2014
- Messages
- 400
I am trying to convert code from early to late binding:
the problem is when I uncomment the lines of code to make it late binding, I don't know what to change this line to:
in particular, the property olByValue
Can someone please help?
Thanks
Rich (BB code):
'*****
' This I early
Dim objOutlook As Outlook.Application
Set objOutlook = New Outlook.Application
Dim objMail As Outlook.MailItem
'*****
' This is late
'Dim objOutlook As Object
'Set objOutlook = CreateObject("Outlook.Application")
'Dim objMail As Object
'Const olMailItem As Long = 0
'*****
Set objMail = objOutlook.CreateItem(olMailItem)
With objMail
.Subject = "E-Mail subject"
With wksLists
Call Create_Picture(wks:=wksLists, _
MyRng:=Range(.Cells(1, 1), .Cells(6, 3)), _
TempName:="AnyName")
End With
TempFilePath = Environ$("Temp") & ""
.Attachments.Add Source:=TempFilePath & "AnyName.jpg", _
Type:=olByValue, _
Position:=0
the problem is when I uncomment the lines of code to make it late binding, I don't know what to change this line to:
Rich (BB code):
.Attachments.Add Source:=TempFilePath & "AnyName.jpg", _
Type:=olByValue, _
Position:=0
in particular, the property olByValue
Can someone please help?
Thanks
Last edited: