View Single Post
 
Old 04-02-2016, 05:11 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
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

The following runs fine when run from within Word. What line of your code is throwing the error?

Code:
Sub Textbox()
Dim wdApp As Word.Application
Dim wdDoc As Word.Document
Dim wdShp As Word.Shape
 'Set wdApp = CreateObject("Word.Application")
 With Application
    .Visible = True
    .ScreenUpdating = False
    Set wdDoc = .Documents.Add
    Set wdShp = wdDoc.Shapes.AddTextbox(Orientation:=msoTextOrientationVertical, Left:=10, Top:=10, Width:=70, Height:=200)
    With wdShp.TextFrame
      .TextRange = "MEMO"
      .TextRange.Font.Name = "Arial"
      .TextRange.Font.Size = "48"
    End With
    .ScreenUpdating = True
  End With
  Set wdDoc = Nothing: Set wdShp = Nothing
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote