Leave text box

O

Old Lars

I have a macro that cuts a selected block of text, creates a text box
at the most recent manual page-break, and pastes the block of text
into the text box.

Then the macro needs to activate the main story on the active page.
But I can't figure out how to get the current selection back OUT of
the text box. I'm sure it's something simple, probably having to do
with wdMainTextStory, but I'm just not getting it. Can anyone help,
please?
 
H

Helmut Weber

Hi Lars,
kind of trial and error approach:
This one creates a frame, puts the selected text in it
and returns to what was selected previously.
Strange, though, as without .EscapeKey
the text in the frame and in the range r will be selected.

Dim r As Range
With Selection
Set r = .Range
.Copy
.Collapse
ActiveDocument.Frames.Add Range:=Selection.Range
.Collapse
.Paste
.EscapeKey
End With
r.Select

HTH
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
 
O

Old Lars

Thanks, Helmut. I ended up using another technique: I realized that I
could set a bookmark just before creating the textbox, then goto the
bookmark after creating the textbox, which would take me out of the
textbox.
 

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