Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Dec 2002
    Canberra, Australian Capital Territory, Australia
    Thanked 0 Times in 0 Posts

    Word 2002 task pane disappears on New document (2002)

    Starting a new blank document hides the task pane in both windows.
    This is not what I would expect. I would expect the task pane state to be preserved. Eg I might have the formatting taks pane visible.

    (I got no hits on a search of MS knowledge base for "task pane' under Word 2002!)

    I have tried to overcome this with a macro, but get a run-time error:

    Sub NewPreserveTaskPane()
    Dim blnPaneVisible As Boolean
    Dim docCurrent As Document
    Dim docNew As Document

    Set docCurrent = ActiveDocument
    blnPaneVisible = docCurrent.CommandBars("Task Pane").Visible

    Set docNew = Documents.Add(DocumentType:=wdNewBlankDocument)

    ' the following line gets run-time error if blnPaneVisible = true
    docCurrent.CommandBars("Task Pane").Visible = blnPaneVisible

    docNew.CommandBars("Task Pane").Visible = blnPaneVisible
    End Sub

  2. #2
    Silver Lounger
    Join Date
    Jun 2001
    Basingstoke, Hampshire, United Kingdom
    Thanked 0 Times in 0 Posts

    Re: Word 2002 task pane disappears on New document (2002)

    Couple of suggestions (I haven't got W2002 so I can't check):

    - The following line will make the task pane visible if it isn't (whilst ignoring it if it is) - I know it seems weird to have to do it like this but I've had VBA get upset if you try to do this sort of thing without the If... before):

    if docCurrent.CommandBars("Task Pane").Visible = false then docCurrent.CommandBars("Task Pane").Visible = true

    - Otherwise, the line causing the error should just read 'blnPaneVisible = true' (or false) - you've already told it that this refers to the task pane visibility. Your line is pretty near to being circular logic, because the previous line says the reverse ...


    *Edited because I left the '= true' bit off the end of the code!*
    Beryl M

Posting Permissions

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