• New Document Task Pane (2003)

    Author
    Topic
    #407462

    Hello,

    I’m driving myself crazy trying to figure out how to refresh the New Document task pane from VBA. I’m trying to hide it then show it (which refreshes its entries if they’ve changed)
    The documentation has the following:

    Sub showFormatting()
        Application.TaskPanes.Item(wdTaskPaneFormatting).Visible = True
    End Sub
    

    But there’s no “wdTaskPaneNewDocument”, and nothing else I’ve tried wants to work.

    If anyone has any ideas, I’d be very grateful.

    Speaking of the New Document Task Pane, here’s some info I’ve compiled. I hope you find it at least more useful than the atrocious VBA documentation for the Task Pane:

    The NewDocument property has two methods, Add and Remove.
    The syntax for Add is as follows:
    Application.NewDocument.Add(FileName, [Section], [DisplayName], [Action]) as Boolean

    The arguments for Add are used as follows:

    *FileName
    The actual name of the file, including the path. Can also be a URL.

    *Section
    The section of the New Document Task Pane where the link will appear. The constants shown in the documentation are misleading or non-existent. Use one of the following four values:
    1 — The New section
    2 — The Recently Used Templates section
    3 — The Templates section
    4 (default) — The Other Files section

    *DisplayName
    The name of the file or URL as it is to appear on the Task Pane

    *Action
    What happens when the link to the file is followed. Again, the constants in the documentation are sketchy, so use one of the following three values:
    1 — Create a new document based on this document or template
    2 — Follow this link as if it were a hyperlink
    3 (default) –Open this document (if it’s a template, it’s opened for editing)

    Registry keys for task pane entries:
    Recent Templates:
    HKEY_CURRENT_USERSoftwareMicrosoftOffice11.0WordRecent Templates

    Other items on New Document Task Pane:
    HKEY_CURRENT_USERSoftwareMicrosoftOffice11.0WordNew Document

    Enjoy!

    Viewing 1 reply thread
    Author
    Replies
    • #852457

      It doesn’t look like you are following the same path as described in Microsoft Knowledge Base Article 288542. Their code uses commandbars rather than jumping straight into TaskPane. Have you tried that method? eg
      With Application.CommandBars(“Task Pane”)
      .Visible = False
      .Visible = True
      End With

      Looking through the list of provided constants for TaskPanes I think the constant you were searching for is the wdTaskPaneDocumentActions but this errors on my Word 2003 machine so perhaps that is a dead end.

      • #852459

        Hi Andrew,

        Yes, I did try the CommandBars method. The problem with that is that it’s the same as choosing View->Taskpane: it shows the last-viewed task pane, not necessarily the New Documents Task Pane.

        I also suspect that what I’m looking for is wdTaskPaneDocumentActions (aka 7), but I also only get errors.

        — Andrew

        • #852461

          If it wasn’t already showing then there wouldn’t be much point in refreshing it then would there bagged

          Can you perhaps try a workaround of calling the File > New control then? That may be the only sure-fire way to call the right task pane since the other methods appear to thwart us.

          • #852463

            Ah, yes, I tried that, too. But all my attempts either open a new, blank document, or open the choose-a-template dialog. I’ll continue experimenting …

          • #852464

            Ah, yes, I tried that, too. But all my attempts either open a new, blank document, or open the choose-a-template dialog. I’ll continue experimenting …

          • #852465

            BTW, I’d like to call your attention to the Description field of the dialog in the attached screen shot, which is completely incorrect. Argh.

            • #852675

              What’s strange is that it works absolutely correctly in Word 2002 (though the description hadn’t quite caught up with the behavior). If the Task Pane is closed, File>New or the FileNew command will display the Task Pane with the New Document pane showing, and if another Task Pane already is showing (e.g., Styles and Formatting), it will navigate it to the New Document Task Pane.

              I find it hard to believe they could/would break this in Word 2003! Any chance you’re intercepting the FileNew command somewhere else? (I tested in a default session {winword.exe

            • #852682

              No dice. I always get the File New dialog, even on a default session.

              This is truly maddening.

            • #852696

              Ditto for CommandBars("Menu Bar").Controls("File").Controls("New...").Execute?

            • #852704

              Jefferson, you’re a genius. I knew there had to be a way.

              Thank you so much.

            • #852705

              Jefferson, you’re a genius. I knew there had to be a way.

              Thank you so much.

            • #852697

              Ditto for CommandBars("Menu Bar").Controls("File").Controls("New...").Execute?

            • #852683

              No dice. I always get the File New dialog, even on a default session.

              This is truly maddening.

            • #852676

              What’s strange is that it works absolutely correctly in Word 2002 (though the description hadn’t quite caught up with the behavior). If the Task Pane is closed, File>New or the FileNew command will display the Task Pane with the New Document pane showing, and if another Task Pane already is showing (e.g., Styles and Formatting), it will navigate it to the New Document Task Pane.

              I find it hard to believe they could/would break this in Word 2003! Any chance you’re intercepting the FileNew command somewhere else? (I tested in a default session {winword.exe

          • #852466

            BTW, I’d like to call your attention to the Description field of the dialog in the attached screen shot, which is completely incorrect. Argh.

        • #852462

          If it wasn’t already showing then there wouldn’t be much point in refreshing it then would there bagged

          Can you perhaps try a workaround of calling the File > New control then? That may be the only sure-fire way to call the right task pane since the other methods appear to thwart us.

      • #852460

        Hi Andrew,

        Yes, I did try the CommandBars method. The problem with that is that it’s the same as choosing View->Taskpane: it shows the last-viewed task pane, not necessarily the New Documents Task Pane.

        I also suspect that what I’m looking for is wdTaskPaneDocumentActions (aka 7), but I also only get errors.

        — Andrew

    • #852458

      It doesn’t look like you are following the same path as described in Microsoft Knowledge Base Article 288542. Their code uses commandbars rather than jumping straight into TaskPane. Have you tried that method? eg
      With Application.CommandBars(“Task Pane”)
      .Visible = False
      .Visible = True
      End With

      Looking through the list of provided constants for TaskPanes I think the constant you were searching for is the wdTaskPaneDocumentActions but this errors on my Word 2003 machine so perhaps that is a dead end.

    Viewing 1 reply thread
    Reply To: New Document Task Pane (2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: