Hi =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=,
How can I tell if the user has the caret in the header/footer (instead of
the document body) and how do I then both read the text at that point and
insert text at that point?
An alternative to Peter's suggestion that returns a more general yes/no
(header/footer or not) answer is
Selection.Information(wdInHeaderFooter)
If you need to know the type, then you can use the wdHeaderFooterType
argument of the Information property (see Word's Help for more details).
As to reading the text at that point, that depends on what it is you want to
pick up? Just the user's selection? Then Selection.Text (also use this to
insert text at this point).
The entire header/footer content? Then
Dim rng as Word.Range
Set rng = Selection.Range
rng.WholeStory
MsgBox rng.Text
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail
