Results 1 to 2 of 2

Thread: Problem to put the word host in an object: Word.Application

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    3

    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:
    1. Dim WithEvents WordApp As Word.Application
    2.  
    3.              Public Sub OnStartupComplete(ByRef custom As System.Array) implements Extensibility.IDTExtensibility2.OnStartupComplete
    4.  
    5.  (*)          WordApp = applicationObject
    6. ' try2        WordApp = DirectCast(applicationObject, Word.Application)
    7. ' try3        WordApp = CType(applicationObject, Word.Application)
    8.  
    9.             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.

  2. #2

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    3

    other informations

    hello everybody

    I'm here again to add that I developped this addin with office 2003 and its libraries of objects: Microsoft Word 11.0 Object Library. version: 8.3. the file is: MSWORD.OLB.

    thanks in advance.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width