none
Wrong activedocument when opening a document in the second form RRS feed

  • Question

  • Hallo,

    I have a problem with Word 2007 and 2010, loosing the active document.

    I have ShowWindowsInTaskbar active and start a userform. In this userform i show a second userform.

    Here i create a document. It does not matter what kind of document. The document is the active document, but if i hide the form or unload it, the active document suddenly is another document (typically the active document before i created the new one). if ShowWindowsInTaskbar is false, everything is fine.

    How can I keep the new created document as  the active document. Is there any trick except creating the document after closing the second form.

    Thanks in advance

    Ingo

    • Moved by Robert Breitenhofer Friday, October 26, 2012 8:11 AM English instead German (From:Microsoft Office System)
    Thursday, October 25, 2012 7:49 PM

Answers

  • I’m assuming that you’re using code to generate the new document? In that case, assign the return value of the Add method to a variable and make use of it.

    Stefan Blom, Microsoft Word MVP
    Friday, October 26, 2012 5:26 PM