Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Misty Perez   on Nov 08 In MS Office Category.

  
Question Answered By: Eshe Chalthoum    on Nov 08

I use a contruction like this:

#If EarlyBinding = 1 Then
Public objWord As Word.Application
Public objDoc As Word.Document
Public objMerge As Word.Document
#Else
Public objWord As Object
Public objDoc As Object
Public objMerge As Object

Public Const wdFormLetters = 0
Public Const wdMainAndDataSource = 2
Public Const wdMainAndSourceAndHeader = 4
Public Const wdSendToNewDocument = 0
Public Const wdDoNotSaveChanges = 0
#End If

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

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Running VBA with an Older Version of Excel Or get search suggestion and latest updates.


Tagged: