kbutler
asked on
Convert my email definitions to late binding
Can someone convert this to late binding?
Dim myolApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myFolder As Outlook.MAPIFolder
Set myolApp = CreateObject("Outlook.Appl ication")
Set myNamespace = myolApp.GetNamespace("MAPI ")
Set myFolder = myNamespace.GetDefaultFold er(olFolde rDrafts)
Dim myolApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myFolder As Outlook.MAPIFolder
Set myolApp = CreateObject("Outlook.Appl
Set myNamespace = myolApp.GetNamespace("MAPI
Set myFolder = myNamespace.GetDefaultFold
ASKER
Acually I have late binding on some of my email procedures but the procedure that I took this code from needs to get into the Drafts forlder.
So the real problem here is the myNamespace and myFolder statements.
So the real problem here is the myNamespace and myFolder statements.
Dim myolApp As object
Dim myNamespace As object
Dim myFolder As object
Set myolApp = CreateObject("Outlook.Appl ication")
Set myNamespace = myolApp.GetNamespace("MAPI ")
Set myFolder = myNamespace.GetDefaultFold er(olFolde rDrafts)
Done.
test be removing your refrence the MS Outlook Obj Library.
Dave
Dim myNamespace As object
Dim myFolder As object
Set myolApp = CreateObject("Outlook.Appl
Set myNamespace = myolApp.GetNamespace("MAPI
Set myFolder = myNamespace.GetDefaultFold
Done.
test be removing your refrence the MS Outlook Obj Library.
Dave
i dont have outlook, so im not sure what value this is.. before you remove Outllok from your refrences in the debug window (intermediate window) type
?olFolderDrafts
and see what its value is, replace olFolderDrafts with this value
?olFolderDrafts
and see what its value is, replace olFolderDrafts with this value
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i need to learn to type faster... lol
Didnt have Outlook (and actually never used it) so i didnt know the value.
ASKER
PendragonZero
16 is the answer. Where do you get a listing of the other numbers?
And thanks for the answer, I tested it.
16 is the answer. Where do you get a listing of the other numbers?
And thanks for the answer, I tested it.
in the intermeditae window just type ?Const
it will return the value (as long as its refrenced)
to open the intermediate window, while in VBA, press ctrl+g
Dave
it will return the value (as long as its refrenced)
to open the intermediate window, while in VBA, press ctrl+g
Dave
And early binding would be:
Set myolApp = New Outlook.Application
of course you need the reference to the Outlook Library where as in late binding you do not
Pen