K
Klaus Linke
Is it possible to select something, but don't have Word automatically scroll
that something into view?
The best I came up with:
Dim oldRange As Range
Set oldRange = Selection.Range.Duplicate
ActiveDocument.Characters(1).Select ' select something else
ActiveWindow.ScrollIntoView obj:=oldRange ' bring the old selection back
into view
.... but that still moves the view a bit.
(Background: I'm writing a macro that helps users edit (specially formatted)
endnotes. The macro should work both when the endnote reference is selected,
or when the cursor already is in some endnote. In the latter case I would
like to select the endnote reference up in the text, but not have Word
scroll it into view)
Regards,
Klaus
that something into view?
The best I came up with:
Dim oldRange As Range
Set oldRange = Selection.Range.Duplicate
ActiveDocument.Characters(1).Select ' select something else
ActiveWindow.ScrollIntoView obj:=oldRange ' bring the old selection back
into view
.... but that still moves the view a bit.
(Background: I'm writing a macro that helps users edit (specially formatted)
endnotes. The macro should work both when the endnote reference is selected,
or when the cursor already is in some endnote. In the latter case I would
like to select the endnote reference up in the text, but not have Word
scroll it into view)
Regards,
Klaus