View Single Post
 
Old 04-02-2016, 04:16 AM
rpb925 rpb925 is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Mar 2016
Location: Sydney
Posts: 17
rpb925 is on a distinguished road
Default Insert and Filling Textbox using VBA

I assume this is straight forward but it isn't really happening for me. I want to:

Add a Text Box to the Right hand Side and have written vertically the word MEMO font size 48 Arial in grey. I have been working from a few things online but to no avail. I am running the code from access in a newly created word document. It always comes up specified value is out of Range and it's starting to get repetitive. Any help is appreciated. P.S I realise I haent added text yet and the box is too small but I haven't gotten that far yet...
Code:
Sub Textbox()
Dim wdApp As Word.Application
Dim wdDoc As Word.Document
Dim wdShp As Word.Shape
Set wdApp = CreateObject("Word.Application")
    
With wdApp
.Visible = True
.ScreenUpdating = False

Set wdDoc = .Documents.Add

    With wdDoc
    Set wdShp = .Shapes.AddTextbox(Orientation:=msoTextOrientationVertical, Left:=10, Top:=10, Width:=10, Height:=10)
    End With
 
.ScreenUpdating = True

End With

Set wdDoc = Nothing: Set wdApp = Nothing: Set wdShp = Nothing

End Sub
Reply With Quote