![]() |
|
#1
|
|||
|
|||
|
hello dears
i found this macro which remove textbox and rewrite its content in body text, but i need to develope it more to make the same in opictures or other shapes (sometimes people put picture in word and type text on it and this make problem for me) Code:
Sub RemoveTextBox2()
Dim shp As Shape
Dim oRngAnchor As Range
Dim sString As String
For Each shp In ActiveDocument.Shapes
If shp.Type = msoTextBox Then
' copy text to string, without last paragraph mark
sString = Left(shp.TextFrame.TextRange.Text, _
shp.TextFrame.TextRange.Characters.Count - 1)
If Len(sString) > 0 Then
' set the range to insert the text
Set oRngAnchor = shp.Anchor.Paragraphs(1).Range
' insert the textbox text before the range object
oRngAnchor.InsertBefore _
"Textbox start << " & sString & " >> Textbox end"
End If
shp.delete
End If
Next shp
End Sub
thanks Last edited by macropod; 02-24-2017 at 08:21 PM. Reason: Added code tags |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What are the minimum margins most printers can handle? | 20GT | Word | 3 | 11-08-2014 10:40 PM |
Display result in textbox based on the input of another textbox
|
scarymovie | Word VBA | 5 | 05-16-2012 07:05 PM |
Shapes don't have green handle
|
rdy4trvl | Drawing and Graphics | 4 | 05-15-2012 09:53 PM |
How does Powerpoint handle resolution of images?
|
noni | PowerPoint | 2 | 08-09-2010 03:32 PM |
| How to handle resources that have Bid on project | rrmccabe | Project | 0 | 03-21-2010 12:39 PM |