Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Script to find/replace formatting

3,858 views
Skip to first unread message

teach...@officeformac.com

unread,
Apr 6, 2008, 11:06:57 AM4/6/08
to
Version: 2008
Operating System: Mac OS X 10.4 (Tiger)
Processor: intel

I need an applescript that will let me find and replace specific formatting within one or more documents. For example, in some I want to find all single underlining and replace that with italics.

Presumably such a script could then get modified easily so that you could substitute plain text for boldface, one font for another, etc. That would make it useful for a wide variety of purposes.

I hope this is the right place for such a query. If not, let me know.

CyberTaz

unread,
Apr 6, 2008, 12:12:22 PM4/6/08
to
You really don't need a *script* for this... Word's Find & Replace feature
will handle just about anything you throw at it. When you open the F&R
dialog click the small button marked with a triangle in the lower left
corner to expand the dialog.Select the formatting you want to Find, select
the formatting you want to Replace it with & let it rip.

However, If your formatting were based on Style in the first place it would
be even easier - you'd just have to change the Style's definition.

HTH |:>)
Bob Jones
[MVP] Office:Mac

On 4/6/08 11:06 AM, in article ee97a...@webcrossing.caR9absDaxw,

teach...@officeformac.com

unread,
Apr 6, 2008, 12:45:25 PM4/6/08
to
Good to know that I can do this via F&R without a script. However, I can't actually seem to achieve this. I followed your instructions, expanded the F&R screen. And then . . . ?

I tried the following:
1. Clicked on No Formatting (bottom left) to gray that out.
2. Clicked on Format>Font right next to it.
3. Clicked into the Find field.
4. Selected the font of my document and Underline>Words only. Got a message underneath that field indicating my choice. Clicked Okay.
5. Clicked into the Replace field.
6. Clicked on No Formatting (bottom left) to gray that out.
7. Selected the font of my document and Italic only. Got a message underneath that field indicating my choice. Clicked Okay.
8. Tried Find Next, Replace, and Replace All with no result.

I tried substituting Cmd+U and Cmd+I, and also underline and italic, in that field, with no result.

So "Select the formatting you want to Find, select the formatting you want to Replace it with & let it rip" doesn't exactly do the trick.

These underlinings are not style-based. They go back to the day when I used that to indicate italics to proofreaders, when I submitted printouts as hard copy, before editors accepted digital files.

Daiya Mitchell

unread,
Apr 6, 2008, 12:48:23 PM4/6/08
to
Fun question. Just by the way/for the archives, there is a built-in
Automator action to save and repeat a Find and Replace in Word 2008, but
it only lets you act on text, not formatting (automator actions not
included in Home and Student version).

CyberTaz is right that this is only worth messing with if you need to be
running the same script over and over again (and then some more), but I
had already written this, so I'm posting it. Also, the F&R dialog will
let you act on all open documents, no clue how to script that.

You know AppleScript, right? I don't, I'm just experimenting. Download
the Word 2004 AppleScript Reference from here. There's a sample script
on page 156 under "Class: Replacement" which can be tweaked to add new
formatting, not just clear found formatting.
http://www.microsoft.com/mac/developers/default.mspx

*HOWEVER*, Word documents, internally, are divided into ranges. That
script only works on the main range of the document. It does not run on
headers/footers or footnotes/endnotes, text boxes, etc. Making a Find
and Replace run on all ranges is discussed here.
http://tinyurl.com/5dvoqt

Free feel to post results/sample scripts back to the archives here for
the edification of all, if you do decide you need a script.

Daiya Mitchell

unread,
Apr 6, 2008, 1:02:08 PM4/6/08
to
If you are not changing the font, there is no need to select anything
there. Try selecting only the Underline and Italic formats, while
ignoring the font.

Also, did you apply Words Only Underline to the document in the first
place? The default cmd-U uses the straight line underline, and if these
docs have been converted, that's probably the one that is applied. Try
the regular underline.

CyberTaz

unread,
Apr 6, 2008, 2:16:39 PM4/6/08
to
Well, in addition to a slight modification to your procedure I suspect there
could be either or both of 2 other factors involved: Since these are
evidently "older" docs it's possible that the font may be a little different
(even though the name may be the same) and/or that the underlining may be
coded somewhat differently than you think. Both should be overcome if you
try it this way [based on your earlier post of wanting to replace single
underlining with italic];

1- When you go to F&R you're already in the Find What field so empty it of
any content & just click the No Formatting button to get a "clean" start.
Then click Format> Font, select the type of underlining (single or Words
Only) from the Underline Style list but make no other changes, OK. NOTE:
there seems to be a bit of a bug when you select Words Only, so if that
phrase doesn't appear *on* the list button when you select it, select it a
2nd time, then OK.)

2- Click in the Replace With field. Clear any content & click No Formatting,
then Format> Font, select Italic from the Font Style list, select None from
the Underline Style list, then OK.

How does that work?

You only need specify a font if you've used more than one font in the doc &
only want to replace TNR [whatever] with Arial [whatever/some other] for
example, but leave any instances of Garamond [whatever] untouched or if you
want to replace the font, itself, with a different font.

HTH |:>)
Bob Jones
[MVP] Office:Mac


On 4/6/08 12:45 PM, in article ee97...@webcrossing.caR9absDaxw,

teach...@officeformac.com

unread,
Apr 6, 2008, 3:12:54 PM4/6/08
to
Thanks to both of you, CyberTaz and Daiya.

FYI, my test file has been a new one in which I underlined a few words.

Your basic suggestions worked. Here's what I did:

1. Open F&R, click No Formatting.
2. Place cursor in Find field, click Format>Font, choose straight line underline, click Okay.
3. Place cursor in Replace field, click Format>Font, choose Italic and Underline>None, click Okay.
4. Click Replace All.

Worked like a charm. I then tested it on one of the older documents I need to massage, and it worked fine there too.

However, I don't (yet) know Applescript -- just a newbie at that. Obviously best to script this, rather than go through all those steps for each affected document. And in some of these documents the underlining also appears in the headers and notes, so I'd want to have it work on all ranges.

I've looked at the script toward which you pointed me . . . and I wouldn't know where to start, alas. Also, it won't compile in Script Editor as is, even after I remove line breaks, etc.

Scripting may be for geeks, but it ain't for sissies.

teach...@officeformac.com

unread,
Apr 6, 2008, 3:16:26 PM4/6/08
to
P.S. I see that I can run the basic F&R operation on All Open Documents, so that's probably the way I'll go -- find a cluster of them, open them, and do this all at once. But a script would make it much easier; as I found such a document, I'd run it and save the revised version.

teach...@officeformac.com

unread,
Apr 6, 2008, 3:48:22 PM4/6/08
to
P.P.S. Okay -- I got that Replace Everywhere script to compile. Had to ferret out various line breaks that snuck in somehow.

But still can't figure out what I would change to get this to substitute italic for underline throughout a document.

Daiya Mitchell

unread,
Apr 6, 2008, 3:56:39 PM4/6/08
to
teach...@officeformac.com wrote:
> P.P.S. Okay -- I got that Replace Everywhere script to compile. Had to ferret out various line breaks that snuck in somehow.
>

They come from copying. I think they get copied from the web in the
wrong format.


> But still can't figure out what I would change to get this to substitute italic for underline throughout a document.
>

Did you download the Word 2004 Reference and look at the sample script
on p156? that's the one that helps with formatting. I'm fairly sure that
it would replace or be incorporated into last section of the Replace
Everywhere script that begins "on ReplaceInRange(findText, replaceText,
theRange)", but I didn't get very far with Replace Everywhere page,
because I didn't quite understand it.

This is as far as I got revising the sample script from the Word 2004
reference--this example replaces italic with underline. But as is, it
only runs on the main text range of the active document, no notes or
header/footers:

tell application "Microsoft Word"
set myFind to find object of text object of active document
clear formatting myFind
set italic of font object of myFind to true
set content of myFind to ""
clear formatting replacement of myFind
set italic of font object of replacement of myFind to false
set underline of font object of replacement of myFind to true
set content of replacement of myFind to ""
execute find myFind replace replace all
end tell

CyberTaz

unread,
Apr 6, 2008, 4:24:46 PM4/6/08
to
<snip>
On 4/6/08 3:12 PM, in article ee97...@webcrossing.caR9absDaxw,
"teach...@officeformac.com" <teach...@officeformac.com> wrote:

> And in some of these documents the underlining also appears in the headers and
> notes, so I'd want to have it work on all ranges.

<snip>

I believe that if you select either Current Document All or All Open
Documents that it will work on H/F as well as body content.

Regards |:>)

teach...@officeformac.com

unread,
Apr 6, 2008, 4:30:05 PM4/6/08
to
The script you sent compiles fine, but doesn't change anything by itself when I run it.

I've looked at the script on p. 156 of the Dictionary. This seems exactly relevant to my situation. The problem: I don't understand where I would drop this into the Replace Everywhere script. If I understand correctly, I'd have to drop it into several spots to affect not just the main body of the text but also headers and footers. And I'd have to create a new TextRange section to handle notes.

Would I replace something already in the script with this material, and then tweak it to effect a substitution of italic for bold? Would I simply add it to the existing script at strategic points, then tweak it?

This set of instructions in the Dictionary reminds me of the road signage of New Jersey -- intended not for someone arriving for the first time but for those who already live there.

Daiya Mitchell

unread,
Apr 6, 2008, 4:38:22 PM4/6/08
to
I just noticed that the Replace Everywhere script doesn't handle
Footnotes. Argh.

And I can't figure out how to incorporate my script into the last part
of Replace Everywhere anyhow. Let me know if you sort it--I can holler
for help tomorrow, but it may take a few days.

CyberTaz

unread,
Apr 6, 2008, 5:01:53 PM4/6/08
to
Current Document All & All Open Documents catches footnotes, endnotes, etc.
as well:-)... But I don't know how to translate that into AppleScript.

Regards |:>)


Bob Jones
[MVP] Office:Mac

On 4/6/08 4:38 PM, in article uTzGpYCm...@TK2MSFTNGP03.phx.gbl, "Daiya

Daiya Mitchell

unread,
Apr 6, 2008, 5:05:37 PM4/6/08
to
teach...@officeformac.com wrote:
> The script you sent compiles fine, but doesn't change anything by itself when I run it.
>

Well, it isn't tweaked for your situation, it's actually reversed from
what you want. On my machine, it changes text in italics to have
underlines, no problem. Does your doc have text in italics? Test it on a
dummy doc. Mine is just a simple variation on the p156 script.


> I've looked at the script on p. 156 of the Dictionary. This seems exactly relevant to my situation. The problem: I don't understand where I would drop this into the Replace Everywhere script. If I understand correctly, I'd have to drop it into several spots to affect not just the main body of the text but also headers and footers. And I'd have to create a new TextRange section to handle notes.
>

Keep in mind that I'm very novice at this, but as I understand it (and
I'm fairly confident about this bit): You don't have to drop it into
several spots. See the section at the end, where it starts "on
ReplaceInRange"? The ReplaceInRange bit is the code that specifies what
the actual replacement will be. Looking above in the script, everytime
you see "my ReplaceInRange", that just calls the script at the end and
runs it. And yes, it needs another section to go through the Footnotes
and call "my ReplaceInRange" for the notes.


> Would I replace something already in the script with this material, and then tweak it to effect a substitution of italic for bold? Would I simply add it to the existing script at strategic points, then tweak it?
>

That's the tricky part. The ReplaceInRange subsection at the end needs
to be edited to do a formatting change, as it's currently set up for a
text change. The findText, replaceText variables are totally confusing
me, and I'm not sure what needs to be edited to make a tweaked
ReplaceInRange subsection interact smoothly with the ReplaceEverywhere
section. Trial and error thus far has not been fruitful, in my attempts
to integrate the formatting F&R script I sent with the ReplaceInRange
subsection.

> This set of instructions in the Dictionary reminds me of the road signage of New Jersey -- intended not for someone arriving for the first time but for those who already live there.
>

Agreed. It's in the subsection of the site entitled Developers, you may
have noticed. I'll send out a cry for help to some more expert people,
but it will probably take a few days, if not more.

teach...@officeformac.com

unread,
Apr 6, 2008, 5:15:20 PM4/6/08
to
If you can figure out how to make this Replace Everywhere script work (including footnotes/endnotes), or get some expert help with it, I'd much appreciate that. And then I think you'd have something worth posting for others to use -- just as I now use your excellent Set Window Size, View, and Zoom script, for which you have my deep gratitude.

If you added some instructions to this on how and where in the script to substitute various formatting options (bold, etc.), it would prove handy for numerous purposes, and not just for me. I can't be the only person who needs to perform such actions.

I'm not afraid of Applescript. I have tweaked some simple scripts myself -- including your Set Window Size, View, and Zoom. But those were comparatively simple scripts, and the tweaks were fairly obvious.

For example, I got Set Window Size, View, and Zoom (in one version) to give me a view of my document that fills 2/3 of my MacBook Pro screen, with text zoomed to 215 percent, in Print Layout, with the left edge flush left against the edge of the screen two toolbars in place at the top, and enough space at the bottom to let the Dock show. And a second version thereof that completely fills the screen of the MBP. Sweet. But this just required some trial-and-error play with the window size and zoom percentage.

One doesn't really need to "know Applescript" in order to achieve something like that. But a script like Replace Everywhere requires know-how to revise and custom-tailor, and short of reading the Dictionary straight through and/or taking an online course in scripting I consider it well past my present ability. As Dirty Harry says, "Man's got to know his limitations." Over time I hope to learn much more,

By the way, I didn't see the Automator F&R to which you referred a few posts back -- not in the cluster that came with Office 2008, anyhow. (And I have the Special Media Edition.)

teach...@officeformac.com

unread,
Apr 6, 2008, 5:25:11 PM4/6/08
to
I fiddled with your script and got it to change underline to italic in the main body of the document. But it doesn't do headers/footers, and it doesn't do endnotes/footnotes.

It's a start, for sure.

Daiya Mitchell

unread,
Apr 6, 2008, 5:35:16 PM4/6/08
to
I'll see what can be done. Glad the Window Size instructions are useful.
Once we sort this, I'll see what can be done about putting similar
samples/tutorial online.

> But a script like Replace Everywhere requires know-how to revise and custom-tailor, and short of reading the Dictionary straight through and/or taking an online course in scripting I consider it well past my present ability. As Dirty Harry says, "Man's got to know his limitations." Over time I hope to learn much more,
>

I'm basically experimenting to try to learn more, which is why I leaped
on your question to mess about with it, but as I've been told by several
experts, trial and error is a bad way to learn AppleScript, and I really
need to start from the basics with a good instructional manual.


> By the way, I didn't see the Automator F&R to which you referred a few posts back -- not in the cluster that came with Office 2008, anyhow. (And I have the Special Media Edition.)
>

Where did you look? In Word itself, there are just a few Sample
Automator Workflows. But if you open in Automator and select MS Word in
it, you'll see about 30 different actions you can tweak and assemble
into workflows. The F&R is there. However, in messing about, I noticed
that the Automator Action fails to search in all ranges, and only
operates in the main document. Making it fairly useless, and subject to
the same problem we have here.

Daiya Mitchell

unread,
Apr 6, 2008, 5:39:10 PM4/6/08
to
No, I was just using it to make sure I was fiddling right and figure out
how the language worked. Setting specific formats to find and replace is
actually a pretty straightforward tweak.

I suspect you've already spent more time messing with the scripting than
it would take you to set up the F&R in the Word dialog over and over
again. :)

teach...@officeformac.com

unread,
Apr 6, 2008, 6:01:51 PM4/6/08
to
"I suspect you've already spent more time messing with the scripting than
it would take you to set up the F&R in the Word dialog over and over
again."

Possibly true. But then I'll have to remember forever exactly how to do that in the Word F&R dialog. If we get it scripted, then every time I look at my script menu I'll see that I have this. And It's a one-step operation, whereas the F&R dialog is about 14 steps each time . . . okay for solving a single occurrence of a problem, but not for multiple occasions.

No rush on this. Whenever you and your accomplices can find the time.

teach...@officeformac.com

unread,
Apr 23, 2008, 9:33:32 PM4/23/08
to
Any forward motion on this find & replace applescript? Still hoping to get it to work.

Shawn Larson [MSFT]

unread,
Apr 24, 2008, 6:55:59 PM4/24/08
to
I’ve included an example below.  This example finds and replaces styles, fonts, and paragraph formatting.  You can certainly modify this code and do replacements for specific formatting and you do not need to include all the formats I’ve included with the example.  

Shawn Larson
Mac Word Test
Microsoft MacBU
--
This posting is provided “AS IS” with no warranties, and confers no rights.
tell application "Microsoft Word"
    activate
   -- Reference the find object of the text object
   set myFind to find object of text object of active document
   
    -- set find and replacement styles/formatting info here
   set findStyle to style heading2
   set replStyle to style heading1
   set findFont to "Times New Roman"
    set replFont to "Arial"
    set findPara to align paragraph left
   set replPara to align paragraph right
   
    (* Replace Styles *)
    -- Add formatting info to find object
   clear formatting myFind
   set style of myFind to findStyle
   
    --  Add formatting info to replacement object
   clear formatting replacement of myFind
   set style of replacement of myFind to replStyle
   
    --  Find and replace all instances
   execute find myFind replace replace all
   
    (* Replace Font Formatting *)
    -- Add formatting info to find object
   clear formatting myFind
   set name of font object of myFind to findFont
   
    --  Add formatting info to replacement object
   clear formatting replacement of myFind
   set name of font object of replacement of myFind to replFont
   
    --  Find and replace all instances
   execute find myFind replace replace all
   
    (* Replace Paragraph Formatting *)
    -- Add formatting info to find object
   clear formatting myFind
   set alignment of paragraph format of myFind to findPara
   
    --  Add formatting info to replacement object
   clear formatting replacement of myFind
   set alignment of paragraph format of replacement of myFind to replPara
   
    --  Find and replace all instances
   execute find myFind replace replace all
end
tell



teach...@officeformac.com

unread,
Apr 24, 2008, 8:23:13 PM4/24/08
to
Thanks much for this, Shawn. Because I'm an Applescript newbie, however, I don't know how to go about paring this down to achieve only what I want to achieve, and using the correct terms in the correct places to specify what I want to find and what I want to replace.

My objective is to find all instances of simple underlining and replace those with italicizing of the previously underlined text.

This includes finding underlined text in the footnotes/endnotes and the headers/footers.

Daiya Mitchell pointed me toward a Replace Everywhere script that she found as a sample script from the Word 2004 reference (as you'll see from one of the posts above). I tweaked this successfully so that it would replace underlining with italicizing in the main text. But I don't know how to get it to do the same thing with text in the footnotes/endnotes and the headers/footers.

Here's that script:

tell application "Microsoft Word"


set myFind to find object of text object of active document

clear formatting myFind
set underline of font object of myFind to true


set content of myFind to ""

clear formatting replacement of myFind

set underline of font object of replacement of myFind to false
set italic of font object of replacement of myFind to true
set content of replacement of myFind to ""


execute find myFind replace replace all
end tell

This works fine -- it just doesn't do the whole job.

Shawn Larson [MSFT]

unread,
Apr 25, 2008, 6:09:33 PM4/25/08
to
Here’s a sample script for you, using your ‘formatting requirements’ for finding and replacing.  It is not the most elegant solution, but I wanted to get a working example posted now, and then later clean it up.  This script will search the main document, all headers and footers, footnotes, endnotes, and shapes.  Enjoy!


Shawn Larson
Mac Word Test
Microsoft MacBU

tell application "Microsoft Word"
    activate
   
    (* Active Document *)

    set myFind to find object of text object of active document
   set content of myFind to ""
    clear formatting myFind
   set underline of font object of myFind to true
   set content of myFind to ""
    clear formatting replacement of myFind
   set italic of font object of replacement of myFind to true
   set underline of font object of replacement of myFind to false
   
    (*Headers & Footers *)
    -- Create list of all sections in active document
   set lstSections to every section of active document
   repeat with currSection in lstSections
       -- Create list of all headers and footers in active document
       set lstHeaderFooters to {get header currSection index header footer primary} & {get header currSection index header footer first page} & {get header currSection index header footer even pages} & {get footer currSection index header footer primary} & {get footer currSection index header footer first page} & {get footer currSection index header footer even pages}
        -- Loop through all headers and footers
       repeat with currHeaderFooter in lstHeaderFooters
           set myFind to find object of text object of currHeaderFooter
           set content of myFind to ""
            clear formatting myFind
           set underline of font object of myFind to true
           clear formatting replacement of myFind
           set content of myFind to ""

            set italic of font object of replacement of myFind to true
           set underline of font object of replacement of myFind to false
           execute find myFind replace replace all
           
            -- Create list of all shapes in header and footer
           set lstShapes to (every shape of currHeaderFooter)
            -- Loop through all shapes in header and footer
           repeat with currShape in lstShapes
               if has text of (text frame of currShape) then
                   set myFind to find object of text range of text frame of currShape
                   set content of myFind to ""
                    clear formatting myFind
                   set underline of font object of myFind to true
                   clear formatting replacement of myFind
                   set content of myFind to ""

                    set italic of font object of replacement of myFind to true
                   set underline of font object of replacement of myFind to false
                   execute find myFind replace replace all
               end if
           end repeat
       end repeat
   end repeat
   
    (* Footnotes *)
    -- Create list of all footnotes in active document
   set lstFtNotes to every footnote of active document
   -- Loop through all footnotes
   repeat with currFtnote in lstFtNotes
       set myFind to find object of text object of currFtnote
       set content of myFind to ""
        clear formatting myFind
       set underline of font object of myFind to true
       clear formatting replacement of myFind
       set content of myFind to ""

        set italic of font object of replacement of myFind to true
       set underline of font object of replacement of myFind to false
       execute find myFind replace replace all
   end repeat
   
    (* Endnotes *)
    -- Create list of all endnotes in active document
   set lstEndNotes to every endnote of active document
   -- Loop through all endnotes
   repeat with currEndnote in lstEndNotes
       set myFind to find object of text object of currEndnote
       set content of myFind to ""
        clear formatting myFind
       set underline of font object of myFind to true
       clear formatting replacement of myFind
       set content of myFind to ""

        set italic of font object of replacement of myFind to true
       set underline of font object of replacement of myFind to false
       execute find myFind replace replace all
   end repeat
   
    (* Shapes *)
    -- Create list of all shapes in main document
   set lstShapes to (every shape of active document)
    -- Loop through all shapes in main document
   repeat with currShape in lstShapes
       set theTextFrame to (text frame of currShape)
        if has text of (text frame of currShape) then
           set myFind to find object of text range of text frame of currShape
           set content of myFind to ""
            clear formatting myFind
           set underline of font object of myFind to true
           clear formatting replacement of myFind
           set content of myFind to ""

            set italic of font object of replacement of myFind to true
           set underline of font object of replacement of myFind to false
           execute find myFind replace replace all
       end if
   end repeat
end
tell

teach...@officeformac.com

unread,
May 2, 2008, 9:06:29 PM5/2/08
to
That almost did the trick, Shawn. It handles the headers/footers and footnotes/endnotes fine. Curiously, however, it leaves the main body of the text untouched.

I substituted the script I posted earlier -- the one that successfully handles the main text -- for the section of your script that deals with the main document. Voila! The system works!

I'll append the revised script to this post. I can't comment on its elegance or lack thereof, and of course I invite you to streamline it to your heart's content. But it does the trick as is. Many thanks.

BTW, I run my tests of this on a test file I created that includes underlined text in main body, header, and footnotes. So I know when it works and when it doesn't.

Also, now that I see where you position the search terms, I can easily tweak this for any other replacement I might desire. As I'm not the only person who needs such a script, I encourage you to post this somewhere as a downloadable .zip file to benefit the Word '08 community.

Here's the revised Underline to Italic script:

tell application "Microsoft Word"


activate

(* Active Document *)
set myFind to find object of text object of active document

clear formatting myFind
set underline of font object of myFind to true
set content of myFind to ""
clear formatting replacement of myFind
set underline of font object of replacement of myFind to false
set italic of font object of replacement of myFind to true
set content of replacement of myFind to ""
execute find myFind replace replace all

teach...@officeformac.com

unread,
May 2, 2008, 9:40:00 PM5/2/08
to
Oops! Somehow the end of that script got cut off in the previous post. Here it is, in full:

end repeat

(* Endnotes *)
-- Create list of all endnotes in active document
set lstEndNotes to every endnote of active document
-- Loop through all endnotes
repeat with currEndnote in lstEndNotes

set myFind to find object of text object of currEndnote


set content of myFind to ""
clear formatting myFind
set underline of font object of myFind to true
clear formatting replacement of myFind
set content of myFind to ""
set italic of font object of replacement of myFind to true
set underline of font object of replacement of myFind to false
execute find myFind replace replace all

end repeat

(* Shapes *)
-- Create list of all shapes in main document
set lstShapes to (every shape of active document)
-- Loop through all shapes in main document


repeat with currShape in lstShapes

set theTextFrame to (text frame of currShape)

teach...@officeformac.com

unread,
May 2, 2008, 9:42:24 PM5/2/08
to
Hmm . . . this keeps cutting off the tail end of my posts. The only part of your script that I changed was the first section, so you have that; I'll leave it to Mac BU to figure out how to post this.
0 new messages