Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Ruben Jackson   on Oct 13 In MS Office Category.

  
Question Answered By: Chau Tran   on Oct 13

Here is some code  that I have used in an Excel file  because I didn't know
what version of Outlook the users were going to be using:

#If EarlyBinding = 1 Then
Public objOLapp As Outlook.Application
Public objOLitem As Outlook.MailItem
#Else
Public objOLapp As Object
Public objOLitem As Object
#End If

Quoted from David Horowitz:
Where EarlyBinding is a compiler option in the project properties
(Tools/Properties for ...). When I develop I use EarlyBinding = 1 and have a
reference to the, in this case, version of Outlook on my computer. You have
all the method and properties with intellisense at your disposal. When
delivering the app I erase the references  and set the compiler option to
EarlyBinding = 0. And voila, no changes to the code because of the public
declarations (object and constants) and RUN!

Share: 

 
 
Didn't find what you were looking for? Find more on Controlling Excel Add-In Loading Or get search suggestion and latest updates.


Tagged: