Thread: late binding
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default late binding

Michelle,
Also with late binding you cannot use the declared constants/enums e.g.
wdFormLetters
You need to check the Help and/or Object Browser to find their actual
values, in this case 0.
Or declare it yourself:
Const wdFormLetters = 0

Another thing to look for is the addition of functionality or additional
arguments that is not present in the earlier version.
Functionality will obviously not be present, so you can't use it. Find a
different method.
Additional arguments are usually optional, so you can delete them.
You would have to check the documentation on the methods for each supported
version to determine this.

NickHK

"Michelle Hanan" wrote in message
...
I am running a macro in Office 2003 and need to run it in XP, so from what

I
understand I need to uncheck the reference to word, since that is where

the
merging is happening and then change the code to "late binding". My

problem
is that looking at the code I can't figure out what to change. Here is the
beginning of the code:

Dim wdApp As Object
Dim myDoc As Word.Document
Set wdApp = CreateObject("Word.Application")
Set myDoc =
Word.Documents.Open("\\powervault2\home_pl\common\ Referrals\Referal

Agency -
Ecology.doc")
ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
ActiveDocument.MailMerge.OpenDataSource Name:= _
"\\powervault2\home_pl\common\Referrals\Referals.x ls", _

Any suggestions?