To use early binding, you first need to set a reference to the Outlook object library. Use the Reference command on the Visual Basic for Applications (VBA) Tools menu to set a reference to Microsoft Outlook xx.x Object Library, where xx.x represents the version of Outlook that you are working with. You can then use the following syntax to start an Outlook session.
Update: I found out through testing that if we used the MS Outlook 16.0 object library, Outlook 2013 would not recognize the reference, and would throw errors that the reference was missing.
microsoft outlook 16.0 object library download
A friend of mine is missing the Microsoft Office XX.0 Object Library. He has office 2016 installed. He is using a code that I generated to export a bill of materials from Inventor to excel. A reference to the Microsoft Office XX.0 Object Library is required. This object Library is not present in the References window (VBA>Tools>References). Is there a way to download another/find in his directory?. Would I be able to give him a copy of my object library? If so, what would be the filename for the library?
I figured it out though. The main issue I was having was determining the location and name of the dll file. For me, the object library was only missing from the references window while using vba editor in Inventor. When I open up excel and pull up its vba window, the object library was not missing from the list.
The next morning I opened Visual Studio 2015 and opened a Visual Basic > Windows > Classic Desktop > Console Application. From the Solution Explorer, I right clicked References > Add Reference. A window came up with an extensive list of object libraries. I found the Microsoft Office 16.0 Object Library that I was looking for, and when I put the cursor over the listed object library, it displayed the full path and file name uncut and uncensored.
Anyways, I can't imagine I am the only one in the world who had or is having this issue with an object library. For Office 2016, here is the full file path, which I imagine will be the same for any user because I believe it is a default directory:
If anyone is having a similar issue with an object library and they know it is on their computer somewhere, employ the aforementioned method using Visual Studio 2015; Community Edition should work fine.
The place where VBA code is written determines the implied context when referring to classes. For example, when using VBA in Outlook and referring to the Application object, it is implied that Application and Outlook.Application are the same object. However, when using VBA in another application to work with Outlook, it is necessary to qualify references to avoid naming collisions with classes in the other application. Using qualified references requires that a reference is set to the library where the classes are defined. If a reference cannot be set, late-binding can be used instead.
f448fe82f3