Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-24-2017, 03:31 PM
romanticbiro romanticbiro is offline handle textbox, pictures, and all kind of shapes Windows 7 32bit handle textbox, pictures, and all kind of shapes Office 2003
Advanced Beginner
handle textbox, pictures, and all kind of shapes
 
Join Date: Feb 2014
Posts: 42
romanticbiro is on a distinguished road
Question handle textbox, pictures, and all kind of shapes

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
please help me if you have another idea.
thanks

Last edited by macropod; 02-24-2017 at 08:21 PM. Reason: Added code tags
Reply With Quote
 



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
handle textbox, pictures, and all kind of shapes Display result in textbox based on the input of another textbox scarymovie Word VBA 5 05-16-2012 07:05 PM
handle textbox, pictures, and all kind of shapes Shapes don't have green handle rdy4trvl Drawing and Graphics 4 05-15-2012 09:53 PM
handle textbox, pictures, and all kind of shapes 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

Other Forums: Access Forums

All times are GMT -7. The time now is 02:17 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft