Results 1 to 7 of 7
  1. #1
    Lounger
    Join Date
    Jan 2003
    Location
    Brisbane, Queensland, Australia
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Selection position in Reviewing Pane? (Word XP)

    I tried to get the selection position when the focus is in the reviewing pane with the Selection object. Suprisingly I found that the object returned is the Selection in the main text. Accroding to the document from MS, every pane of every window of every document has a Selection, but what I get from its API is something else. More interestingly, the "Active" attribute of this Selection is False. You can try it with the following macro:
    ------------------------------------------------------
    Sub CommentPos
    MsgBox "Pos="+Str(ActiveDocument.ActiveWindow.ActivePane. Selection.Start)
    MsgBox "Story="+Str(ActiveDocument.ActiveWindow.ActivePan e.Selection.StoryType)
    MsgBox "Active="+Str(ActiveDocument.ActiveWindow.ActivePa ne.Selection.Active)
    End Sub
    -----------------------------------------------------

    If you place the caret in the reviewing pane and run this macro, you will find all information displayed is for the main text story.

    But I do need the selection position in the Reviewing Pane. Can anyone suggest a workaround?

    Thx

  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: Selection position in Reviewing Pane? (Word XP

    Good grief, I get False for this (in the Immediate window):

    ?selection.Information(wdInCommentPane)

    What have they done?! I think this must have broken some Word 97-2000 code. Perhaps there are solutions out there on the web or in usenet news?

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Selection position in Reviewing Pane? (Word XP

    The Reviewing Pane is not the same as the Comment Pane. The latter is still available through WordBasic.InsertAnnotation. If you do that, Selection.Information(wdInCommentPane) will return True, and mandelbrot's macro will display information relating to the selection position in the comment pane.

    The developers clearly hadn't gotten around to integrating the new Reviewing Pane into Visual Basic for Word 2002. I don't have Word 2003, so I don't know if it's better there.

  4. #4
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Selection position in Reviewing Pane? (Word XP

    This is no different in Word 2003 SP1

    StuartR

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Selection position in Reviewing Pane? (Word XP

    Thanks for investigating. I fear that the developers are losing control over the Word VBA object model. There are several things that used to work, but don't any more (at least not correctly) in recent versions, and support for new features such as the task panes is meagre.

  6. #6
    Lounger
    Join Date
    Jan 2003
    Location
    Brisbane, Queensland, Australia
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Selection position in Reviewing Pane? (Word XP

    I also noticed that the old comment pane appears when I created the comment with VBA. Although this pane looks slightly different from the comment pane in Word 2000, the Selection object still works. But this pane only appears while a comment is created in this way. In other cases, I always get the new reviewing pane. It seems that MS is interested in producing fancy features rather than making them stable.

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Selection position in Reviewing Pane? (Word XP

    MS is not the only company guilty of that, I guess.

    But all this hasn't brought us closer to a solution to your problem. I fear that the position of the selection in the Reviewing pane is not available to VBA. Word must keep track of it internally, of course, but I don't see a way to get at this information.

Posting Permissions

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