adding reference to the Word-Library

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

For an application i'm wirting in Excel (VBA) I will open a template in Word and add information to that template from within my Excel-sheet.

I've discovered that I need a reference for that to the Word-Library. (Tools -> References -> etc...)

The problem is that when someone tries to run the application on a computer that doesn't have that reference enabled, the code doesn't work...

Does anyone know how to check whetter the reference is made or not and, -if not- how to enable it?

Greets

Guido van Gemerden
g.vangemerden*NOSPAM*@*PLEASE*basic-it.nl
 
Hi Guido
Please note file name reference differs according to office version
installed (code below works with Office xp and 2003)
On Error Resume Next
MyRef = ThisWorkbook.VBProject.References("Word").Description
If Err <> 0 Then
ThisWorkbook.VBProject.References.AddFromFile (Application.Path &
"\MSWORD.OLB")
End If
HTH
Regards
Pascal

"Guido van Gemerden" <Guido van (e-mail address removed)> a écrit
dans le message de
Hi,

For an application i'm wirting in Excel (VBA) I will open a template in
Word and add information to that template from within my Excel-sheet.
I've discovered that I need a reference for that to the Word-Library.
(Tools -> References -> etc...)
The problem is that when someone tries to run the application on a
computer that doesn't have that reference enabled, the code doesn't work...
Does anyone know how to check whetter the reference is made or not
and, -if not- how to enable it?
 
Back
Top