Results 1 to 10 of 10
  1. #1
    3 Star Lounger
    Join Date
    Apr 2004
    Location
    Boston, Massachusetts, USA
    Posts
    389
    Thanks
    0
    Thanked 0 Times in 0 Posts

    New Document Task Pane (2003)

    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:
    <pre>Sub showFormatting()
    Application.TaskPanes.Item(wdTaskPaneFormatting).V isible = True
    End Sub
    </pre>


    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.0WordRe cent Templates

    Other items on New Document Task Pane:
    HKEY_CURRENT_USERSoftwareMicrosoftOffice11.0WordNe w Document

    Enjoy!

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,853
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: New Document Task Pane (2003)

    It doesn't look like you are following the same path as described in <!mskb=288542>Microsoft Knowledge Base Article 288542<!/mskb>. 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.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    3 Star Lounger
    Join Date
    Apr 2004
    Location
    Boston, Massachusetts, USA
    Posts
    389
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: New Document Task Pane (2003)

    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

  4. #4
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,853
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: New Document Task Pane (2003)

    If it wasn't already showing then there wouldn't be much point in refreshing it then would there <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

    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.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  5. #5
    3 Star Lounger
    Join Date
    Apr 2004
    Location
    Boston, Massachusetts, USA
    Posts
    389
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: New Document Task Pane (2003)

    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 ...

  6. #6
    3 Star Lounger
    Join Date
    Apr 2004
    Location
    Boston, Massachusetts, USA
    Posts
    389
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: New Document Task Pane (2003)

    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.
    Attached Images Attached Images

  7. #7
    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: New Document Task Pane (2003)

    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

  8. #8
    3 Star Lounger
    Join Date
    Apr 2004
    Location
    Boston, Massachusetts, USA
    Posts
    389
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: New Document Task Pane (2003)

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

    This is truly maddening.

  9. #9
    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: New Document Task Pane (2003)

    Ditto for <code>CommandBars("Menu Bar").Controls("File").Controls("New...").Execute </code>?

  10. #10
    3 Star Lounger
    Join Date
    Apr 2004
    Location
    Boston, Massachusetts, USA
    Posts
    389
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: New Document Task Pane (2003)

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

    Thank you so much.

Posting Permissions

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