Activating cursor at insertion point in Word 2003 Reading Layout View

J

Jack Dignan

Upon switching into Reading Layout view in Word 2003, the cursor (i.e.
current insertion point) is not visible. Because Word is in this state, i.e.
the insertion point is not active, many menu commands are disabled, such as
Insert | Field. None of the other views behave this way; the insertion point
is always visible upon entering another view.

In Reading Layout view, clicking in the gray area around the page will
activate (i.e. show) the cursor at the current insertion point, as will
doing Edit | Paste; possibly other commands will activate the cursor as
well.

How can you activate the cursor at its current position in Reading Layout
view from a VBA macro? I have a macro that inserts a field via
Selection.Fields.Add, but it fails if the user is in Reading Layout view and
hasn't yet clicked somewhere in the document or window.

Thanks,
Jack
 
C

Chad DeMeyer

Perhaps you could just capture the current view in a variable, switch to the
preferred view to insert the field (e.g., Print Layout), and then restore
the user's original view?

Regards,
Chad DeMeyer
 
C

Cindy M -WordMVP-

Hi Jack,

In a quick test, this appears to work (although I still don't see the cursor)

Dim doc As Word.Document
Dim rng As Word.Range

Set doc = Documents.Open("C:\test\MergeTest1.doc")
doc.ActiveWindow.View = wdReadingView

Set rng = Selection.Range
rng.Characters(1).Select
doc.Fields.Add rng, wdFieldPage

If I test Selection.Type I get back IP (insertion point), so the selection is
definitely there, and recognized by VBA. It's just sorta odd... But working
with Ranges doesn't seem to present any problems, once the range contains
something "substantial".
Upon switching into Reading Layout view in Word 2003, the cursor (i.e.
current insertion point) is not visible. Because Word is in this state, i.e.
the insertion point is not active, many menu commands are disabled, such as
Insert | Field. None of the other views behave this way; the insertion point
is always visible upon entering another view.

In Reading Layout view, clicking in the gray area around the page will
activate (i.e. show) the cursor at the current insertion point, as will
doing Edit | Paste; possibly other commands will activate the cursor as
well.

How can you activate the cursor at its current position in Reading Layout
view from a VBA macro? I have a macro that inserts a field via
Selection.Fields.Add, but it fails if the user is in Reading Layout view and
hasn't yet clicked somewhere in the document or window.

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 :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top