Solved

MS Word 2010 - Convert Text Boxes + Autoshapes to Text

Posted on 2014-01-29
10
834 Views
Last Modified: 2014-02-03
Need a MS Word 2010 macro that

1, selects all text boxes and autoshapes
2. converts the text inside to regular text

I expect that the text will end up rather scrambled, but that is ok.
0
Comment
Question by:cmd407
  • 6
  • 3
10 Comments
 
LVL 48

Expert Comment

by:Rgonzo1971
Comment Utility
Hi,

pls try

Sub ConvertTextBoxes()

For Each oShape In ActiveDocument.Shapes
    If oShape.TextFrame.HasText = True Then
        oShape.Select
        
        strText = oShape.TextFrame.TextRange.Text
        oShape.ConvertToInlineShape
        oShape.Delete
        Selection.TypeText strText
    End If
Next

End Sub

Open in new window

Regards
0
 

Author Comment

by:cmd407
Comment Utility
It sticks on line 8:
 oShape.ConvertToInlineShape
0
 
LVL 48

Accepted Solution

by:
Rgonzo1971 earned 500 total points
Comment Utility
Let's try without
Sub ConvertTextBoxes()

For Each oShape In ActiveDocument.Shapes
    If oShape.TextFrame.HasText = True Then
        oShape.Select
        
        strText = oShape.TextFrame.TextRange.Text
        oShape.Delete
        Selection.TypeText strText
    End If
Next

End Sub

Open in new window

0
 

Author Comment

by:cmd407
Comment Utility
I have 9 text boxes arranged vertically and numbered by the text inside.  Your macro  converted these boxes 1,3,5,7,9 with the first run.  Then 2, 6.  Then 4. Then 8.  You are definitely on the right track.  Had to run it over and over to convert all.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 48

Expert Comment

by:Rgonzo1971
Comment Utility
Without a dummy example it will be difficult to know where is the Problem

Regards
0
 

Author Comment

by:cmd407
Comment Utility
I made the quick test dummy by drawing nine text boxes, dragging them in a vertical order, and typing 1asdf in the first 2asdf in the second and so on.
0
 

Author Comment

by:cmd407
Comment Utility
Hey, tried it again on the original project and it got all but one box the first time.  I am happy and appreciate what you have done.  Not sure what is going on with the tester,
0
 

Author Comment

by:cmd407
Comment Utility
This will save me hours of clicks.  What a great help!
0
 

Author Comment

by:cmd407
Comment Utility
Sorry - meant to accept this version Posted on 2014-01-29 at 10:17:32.  Can someone fix that to avoid confusing users?
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now