Results 1 to 5 of 5
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Office COM add-in with VB .NET: Error with Word (VB .NET)

    MSFT KB article 302896 includes a step by step example demonstrating how to build an Office COM in VB .NET.

    Using VB .NET 2003 Pro and Office 2003 Pro, I implemented the example and it works correctly when starting each of the following apps from the quick launch bar: Access, Excel, Outlook, Powerpoint and Word.

    I then tried to open an extant Word document. I tried two docs, one already existed, the other was just created anew on the desktop.

    When I double clicked on each document, I got an error message from Microsoft Office Word. The message was:

    "The command cannot be performed because a dialog box is open. Click OK, and then close open dialog boxes to continue."

    This error is being caused by the display of either of two message boxes.

    One msgbox is in the OnConnection method, the other is in the OnStartupComplete method.

    If I comment out those two message boxes, the Word error does not occur.

    This error occurs ONLY if I open an extant Word document using Windows Explorer or on the desktop. Error does not occur if I start Word either from Start | Programs, or from the icon in the quick launch task bar.

    The error does not occur with Access, Excel, or Powerpoint.

    I searched MSDN and the KB and could not find the error message.

    Any solutions?

    It would be useful if someone could recreate the example from the KB article and let us know whether they see the same behavior.

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Office COM add-in with VB .NET: Error with Word (VB .NET)

    Did you rule out the possibility of other add-ins or global templates being in conflict with the new COM add-in?

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Office COM add-in with VB .NET: Error with Word (VB .NET)

    Same problem even if I delete Normal template and global templates.

    Problem occurs only opening extant Word document, not if I just click on word icon to start Word.

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Office COM add-in with VB .NET: Error with Word (VB .NET)

    Is the document's attached template simply Normal.dot? My suspicion is that "something" is running when a document is opened that has a timing problem with the new add-in, whether it's a commandbar customization (my initial suspicion) or something else.

  5. #5
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Office COM add-in with VB .NET: Error with Word (VB .NET)

    I've already stated that Normal and the global templates were removed.
    There are no other customizations.

    I was hoping that someone would try constructiong the example in the KB article to see what behavior they experience.
    I've tried this only with VB .NET 2003 and Office 2003.

Posting Permissions

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