View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
RB Smissaert RB Smissaert is offline
external usenet poster
 
Posts: 2,452
Default Dynamic References to Word?

Sub ActivateWordLibrary()

Dim R

On Error Resume Next

'no need to carry on if the Word Object Library is already there
'---------------------------------------------------------------
For Each R In ThisWorkbook.VBProject.References
If R.GUID = "{00020905-0000-0000-C000-000000000046}" Then
Exit Sub
End If
Next

ThisWorkbook.VBProject.References.AddFromGuid _
GUID:="{00020905-0000-0000-C000-000000000046}", _
Major:=0, Minor:=0

On Error GoTo 0

End Sub

You can remove the reference after, but not really neccessary.

RBS


"Newbie" wrote in message
...
Hello
As the Late Binding seems very slow, I would like to create a reference on
Word 2000 or Word 2003 (Several PCs are running Office 2000, some others
are
running Office 2003.
How can i create a Reference for Microsoft Word 9.0 or for Microsoft Word
11.0 (2000 and 2003)?
How to remove this Reference after the VBA procedure has done its work?
Thanks