The following macro insert a textbox with the $ sign in it. How do I get out
of the textbox and back into the main document after it runs?
Dim textbox As Shape
Dim i
i = Selection.Information(wdVerticalPositionRelativeToPage)
ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 35, _
i - 5, 22, 24).Select
Selection.ShapeRange.TextFrame.TextRange.Select
Selection.Collapse
Selection.Font.Size = 14
Selection.TypeText Text:="$"
Selection.ShapeRange.Fill.Visible = msoFalse
Selection.ShapeRange.Line.Visible = msoFalse
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Fill.Transparency = 0#
CommandBars("Stop Recording").Visible = False
Selection.ShapeRange.Select
Shauna Kelly - 28 Feb 2007 07:38 GMT
Hi
See
http://groups.google.com.au/group/microsoft.public.word.vba.general/browse_frm/t
hread/3c76f6aa05d1db4c
Hope this helps.
Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
> The following macro insert a textbox with the $ sign in it. How do I get
> out
[quoted text clipped - 15 lines]
> CommandBars("Stop Recording").Visible = False
> Selection.ShapeRange.Select
Jezebel - 28 Feb 2007 07:44 GMT
Better to write your macro so you don't change the selection; then the
problem doesn't arise --
With ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 35,
Selection.Information(wdVerticalPositionRelativeToPage)
- 5, 22, 24)
With .TextFrame.TextRange
.Text = "$"
.Font.Size = 14
End With
.Fill.Visible = msoFalse
.Line.Visible = msoFalse
End With
But probably simpler still is to define your textbox, ready-formatted and
positioned relative to its anchor, as an Autotext entry; then just insert
it.
> The following macro insert a textbox with the $ sign in it. How do I get
> out
[quoted text clipped - 15 lines]
> CommandBars("Stop Recording").Visible = False
> Selection.ShapeRange.Select
Fuzzhead - 01 Mar 2007 03:13 GMT
Thank you for the help and info.
Fuzzhead
> Better to write your macro so you don't change the selection; then the
> problem doesn't arise --
[quoted text clipped - 33 lines]
> > CommandBars("Stop Recording").Visible = False
> > Selection.ShapeRange.Select