|
-
Jul 21st, 2004, 11:27 AM
#1
Thread Starter
New Member
Problem to put the word host in an object: Word.Application
I'm developping a simple VB.NET COM addin for office 2000, XP, 2003 on Windows 2000, XP, 2003. When Word is launched, the method OnStartupComplete (of my addin), tries to retrieve the Word application which is the host application and to place it in a variable wordApp, which type is: Word.Application.
VB Code:
Dim WithEvents WordApp As Word.Application
Public Sub OnStartupComplete(ByRef custom As System.Array) implements Extensibility.IDTExtensibility2.OnStartupComplete
(*) WordApp = applicationObject
' try2 WordApp = DirectCast(applicationObject, Word.Application)
' try3 WordApp = CType(applicationObject, Word.Application)
end sub
where applicationObject is a reference to the host Application.
But at this time: (*), an Exception is thrown: "Exception from HRESULT: 0x80040200", even with try2 and try3.
What is strange with this problem, is that it doesn't work on WinXP + OfficeXP, but on other OS and Office configurations, it properly works (eg: Win2000 + Office 2003)
Thanks in advance for helping a young trainee.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|