I having real trouble accessing textbox text via VBA if in a drawing canvas.
Searching this + elsewhere show I should be able to access the text using "TextFrame.TextRange", but it fails, and debug shows no data present (I can't post an image as i'm <10 feedbacks)
Please have a try: - make a new word document, - add a drawing canvas and put a textbox inside with some dummy text - try to access/modify it via VBA Many thanks = )
For Each shp In ActiveDocument.Shapes
If shp.Type = msoCanvas Then
For Each canvasitem In shp.CanvasItems
If canvasitem.Type = msoTextBox Then
' NONE OF THESE WORK - WHAT AM I MISSING?
'Debug.Print canvasitem.TextFrame.TextRange.Text
'Debug.Print canvasitem.TextFrame.TextRange.Characters.Text
'If canvasitem.TextFrame2.HasText = True Then _
' Debug.Print canvasitem.TextFrame2.TextRange
End If
Next
End If
Next