Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add Reference to Multiple Versions of Object Library

Status
Not open for further replies.

dolfo35

Programmer
Jan 26, 2001
28
US
Hello,

Can anyone please tell if it is possible to add a reference to Microsoft Word 11.0 Object Library AND Microsoft Word 10.0 Object Library? I only see 11.0 under the Com tab. How do I go about adding 10.0 as well so that it would even be possible to add a reference to it?

After I am able to add both references, I will also need to write code to determine what version of Word is installed on the client computer. If you have ever done this, sample code would be greatly appreciated.

Thanks.
Rudy

p.s. I've spent a couple of hours Google-ing for the answer to these questions but have not been successful. I'm hoping that I just was not looking for the right keywords.
 
Hi

Came across the same problem here today.
Did u find a solution to this?

If so can u tell me how?

Staleb
 
Not sure on 10 and 11, but I know 9 and 10 have different DLLs. Do you have both versions of Office installed?

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Hi

No I only have office 2003 installed, with
Microsoft Word 11.0 Object Library. Which gives me an error message when I try to:
oWord = CreateObject("Word.Application")

And when I search MSDN, they all refer to
Microsoft Word 10.0 Object Library.
Which leeds me to think that I really need:
Microsoft Word 10.0 Object Library.
But where can I find it?
 
Microsoft Word 11.0 Object Library. Which gives me an error message when I try to:
oWord = CreateObject("Word.Application")

What is the error message?

I can never keep Word 2k3/XP straight, open word goto help->about and see what version it is (10 or 11)

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Word 2k3 is version 11

The error message says that:
"cannot create the Active-X component"

The reaseon I think I need 10 library is:

When I do the same with an Excel object the:
xlApp = CreateObject("Excel.Application")
Works fine, but when the next line i executed:
xlBook = xlApp.Workbooks.Add
It raises an error, saying:
"Old format or ilegeal type Library"


So I am looking for to get
Microsoft Word 10.0 Object Library

Do u know where I can get it?
 
Install Work XP. Then you'll have access to the Word 10 object library.

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
This is the code that I used. It now works with 10 or 11.

Private Sub OpenDocument(ByVal strWordDoc As String)

'Create an instance of Word and make it visible
wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True

'Open the main document
wrdDoc = wrdApp.Documents.Open(strWordDoc)


End Sub

Hope this helps.
Rudy
 
Thats what I do:

wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True

but when the CreateObject command is executed,
it says:
"Can not create ActiveX-component"

If I declare wrdApp this way

Dim WrdApp as word.application
WrdApp = new Word.application

"The module was not found"


And I have no clue whats wrong!

it says the
 
staleb,

I have it declared different. I'm not sure where I found this, but I have this in a module:

Public wrdApp As Object
Public wrdDoc As Word._Document

Also, not remembering why, I have this line in the same module:

Imports Word = Microsoft.Office.Interop.Word

I think that might have to do with "Word._Document"

Hope this helps you out. I know how frustrating it was for me. Let me know if I can be of more assistance.

Rudy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top