Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2004

Tip: Looking for answers? Try searching our database.

Leave text box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Old Lars - 28 Nov 2004 16:10 GMT
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?
Helmut Weber - 28 Nov 2004 17:56 GMT
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/
Old Lars - 30 Nov 2004 04:37 GMT
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.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.