Dan said:
This is more of a curiosity than anything else. Why isn't "selection"
an object or property of the ActiveDocument? It seems like it should be,
but I only find it under the Application object?
Hi Dan,
You can also find it under ActiveDocument.ActiveWindow.ActivePane.
My guess is that a lot of complexity is hidden here.
You can have several docs open and each "remembers" its Selection if you
activate it... Same with selections done in different panes of the same
document if you switch between panes.
The help seems a bit misleading: It claims that there can only be one
Selection object in the application (... which may explain why you found it
there in the Object Model).
But I can select say the letter "a" in one pane, "b" in another, and
retrieve the text of both:
? ActiveDocument.ActiveWindow.Panes(1).Selection.Text
a
? ActiveDocument.ActiveWindow.Panes(2).Selection.Text
b
That doesn't quite answer your question... Just my 2¢
Klaus