Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MS Word 2010 - Convert Text Boxes + Autoshapes to Text

Posted on 2014-01-29
10
Medium Priority
?
1,075 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
10 Comments
 
LVL 53

Expert Comment

by:Rgonzo1971
ID: 39817864
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
ID: 39818220
It sticks on line 8:
 oShape.ConvertToInlineShape
0
 
LVL 53

Accepted Solution

by:
Rgonzo1971 earned 2000 total points
ID: 39818550
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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 

Author Comment

by:cmd407
ID: 39818761
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
 
LVL 53

Expert Comment

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

Regards
0
 

Author Comment

by:cmd407
ID: 39818882
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
ID: 39818900
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
ID: 39819001
This will save me hours of clicks.  What a great help!
0
 

Author Comment

by:cmd407
ID: 39819015
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

618 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