Share via

Create A Macro to Insert A Shape and Text Box

Anonymous
2014-07-23T17:14:51+00:00

I have created a vehicle body damage form and would like to add a command button to run a macro that will add a text box (no fill and no border) with the letter "A" in it.

I also need to have one with a macro assigned to it that will add and arrow from the shapes menu.

Would someone be willing to help me with the macros needed for this?

Thanks,

Ron

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2014-07-24T01:12:48+00:00

This macro should get you started

Sub AddATextBox()

  Dim aShp As Shape

  Set aShp = ActiveDocument.Shapes.AddShape(Type:=msoShapeRectangle, Left:=100, Top:=100, _

              Width:=25, Height:=25, Anchor:=Selection.Paragraphs(1).Range)

  With aShp

    .TextFrame.TextRange = "A"

    .TextFrame.TextRange.Font.ColorIndex = wdBlack

    .Fill.Visible = msoFalse

    .RelativeHorizontalPosition = wdRelativeHorizontalPositionMargin

    .RelativeVerticalPosition = wdRelativeVerticalPositionParagraph

    .Left = 0

    .Top = 0

  End With

End Sub

Was this answer helpful?

3 people found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2017-09-04T11:15:53+00:00

    Hi I need a macro that can insert a text box (no border just white no fill) and a red arrow coming from the text box. I am using this for reporting to label drawings were i have found defects on the mining equipment i have inspected.  Any help would be amazing i have tried to create one myself to no success. Macro writing is something i really want to learn but i dont know were i can learn to do it

    Was this answer helpful?

    0 comments No comments