B
Bill Sturdevant
I am trying to use VBA code to enter a line of text, and then add an MSGraph
Chart on the very next line, anchored to the text. I am using the following
code, but need to know what to use for the Anchor property:
Selection.TypeText Text:="My text goes here"
Selection.TypeParagraph
Dim oWordApp As Word.Application
Dim oWordDoc As Word.Document
Dim oShape As Word.Shape
Set oWordApp = GetObject(, "Word.Application")
Set oWordDoc = ActiveDocument
'Embed a chart on the document.
Set oShape = oWordDoc.Shapes.AddOLEObject( _
Width:=150, Height:=150, _
ClassType:="MSGraph.Chart", DisplayAsIcon:=False, _
Anchor:=<<<WHAT GOES HERE?>>>)
Chart on the very next line, anchored to the text. I am using the following
code, but need to know what to use for the Anchor property:
Selection.TypeText Text:="My text goes here"
Selection.TypeParagraph
Dim oWordApp As Word.Application
Dim oWordDoc As Word.Document
Dim oShape As Word.Shape
Set oWordApp = GetObject(, "Word.Application")
Set oWordDoc = ActiveDocument
'Embed a chart on the document.
Set oShape = oWordDoc.Shapes.AddOLEObject( _
Width:=150, Height:=150, _
ClassType:="MSGraph.Chart", DisplayAsIcon:=False, _
Anchor:=<<<WHAT GOES HERE?>>>)