View Single Post
 
Old 07-31-2017, 12:41 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey, http://gregmaxey.com/word_tips.html, 7/31/2017
Dim oShp_TB As Shape
  '1.
  Set oShp_TB = ActiveDocument.Shapes.AddTextbox( _
        Orientation:=msoTextOrientationHorizontal, _
        Left:=50, Top:=50, Width:=100, Height:=100)
  With oShp_TB
     With .TextFrame.TextRange
      '2.
      .Text = "This is some text"
      '3.
      .Font.Name = "Calibri"
      .Font.Size = 8
      .Font.ColorIndex = wdBlue
      .ParagraphFormat.Alignment = wdAlignParagraphCenter
      'Or use a defined style
      '.Style = "My TextBox Style"
    End With
    '4.
    With .Line
      .Weight = 2
      .ForeColor = wdColorRed
    End With
    '5.
    .Left = 200
    .Top = 300
  End With
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote