Sub FindWordArtTextInWord2007()
Dim doc As Document
Dim shp As Shape
Dim msg As String
Set doc = ActiveDocument
msg = "Wordart content:" & vbCrLf
For Each shp In doc.Shapes
If shp.Type = msoTextBox Or shp.Type = msoAutoShape Then
If Not shp.TextFrame Is Nothing And Not shp.TextFrame.TextRange Is Nothing Then
msg = msg & shp.TextFrame.TextRange.Text & vbCrLf
End If
End If
Next shp
MsgBox msg, vbInformation, "WordArt text :"
Set doc = NothingEnd Sub
Sub FindWordArtTextInWord2007()
Dim doc As Document
Dim shp As Shape
Dim msg As String
Set doc = ActiveDocument
msg = "Wordart content:" & vbCrLf
For Each shp In doc.Shapes
If shp.Type = msoTextEffect Then
If Not shp.TextEffect Is Nothing Then
msg = msg & shp.TextEffect.Text & vbCrLf
End If
End If
Next shp
MsgBox msg, vbInformation, "WordArt text :"
Set doc = Nothing
End Sub
still nothingSub FindWordArtTextInWord2007() Dim doc As Document Dim shp As Shape Dim msg As String Set doc = ActiveDocument msg = "Wordart content:" & vbCrLf For Each shp In doc.Shapes If shp.Type = msoTextEffect Then If Not shp.TextEffect Is Nothing Then msg = msg & shp.TextEffect.Text & vbCrLf End If End If Next shp MsgBox msg, vbInformation, "WordArt text :" Set doc = Nothing End Sub
what's your office version?I ran your code as posted in post #2 and it worked for me:
View attachment 110609
In my case it sees the WordArt I added as type msoTextBox.
Dim shp As Object
For Each shp In doc.InlineShapes
If shp.Type = msoTextEffect Then
If Not shp.TextEffect Is Nothing Then
msg = msg & shp.TextEffect.Text & vbCrLf
End If
End If
Next shp