#1
|
|||
|
|||
Convert Text Boxes to Normal Text in Word Using VBA Code
Hi,
Please how to convert already text boxes in Word to normal or plain text, sometimes, I copied text boxes from PowerPoint. I used many codes on the internet for this purpose, but all does not fulfill my need, such as Removing All Text Boxes In a Document (Microsoft Word) Any fix, suggestion, please? Use demo file Thanks |
#2
|
||||
|
||||
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 I'm not sure if the numbering order uses Z-Order, creation order or physical location on the page.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
Quote:
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 |
Tags |
vba, word vba, word vba code |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Convert all equations to "Normal Text" | b0x4it | Word VBA | 16 | 02-14-2023 03:52 AM |
Creating and Referencing Drop Down Text Boxes in VBA code | cjkmarx | Word VBA | 1 | 12-12-2016 03:20 PM |
Word 2013 Text boxes on everything, can't select across multiple boxes | 1Kurgan1 | Word | 2 | 10-31-2016 01:20 AM |
Drawing lines between text boxes which have actual text within the text boxes | RHODIUM | Word | 6 | 10-01-2016 04:43 PM |
Converting normal text boxes into placeholders? | thousandred | PowerPoint | 0 | 12-08-2010 09:59 PM |