View Single Post
 
Old 03-09-2023, 11:51 PM
laith93 laith93 is offline Windows 10 Office 2019
Competent Performer
 
Join Date: Jul 2021
Posts: 117
laith93 is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
The basic principle is as follows
Code:
Sub FlattenTextBoxes()
  Dim shp As Shape, iShp As Integer, sString As String
  For iShp = ActiveDocument.Shapes.Count To 1 Step -1
    Set shp = ActiveDocument.Shapes(iShp)
    If shp.TextFrame.HasText Then
      sString = shp.TextFrame.TextRange.Text
      shp.Anchor.InsertBefore sString
      shp.Delete
    End If
  Next iShp
End Sub
Dear Andrew,
Thanks so much for this great help
The basic reason for this appearance is when I convert a PowerPoint file (in pdf format downloaded from the net) to ppt again, every line is converted to a textbox, after running your macro, it flattened all the textboxes to standard plain text.
Now everything is ok, although it requires returning each line to its corresponding paragraph.

However, Thanks again with my respect, you helped me and saved my time.
Best Wishes
Reply With Quote