I'm writing a script that selects a large crossword grid (19cm x 19cm), and changes the font and alignment before exporting out as an eps.
When I run the code below, it starts off selecting the frames quickly and then gradually slows to a crawl, before being painfully slow at the end. It takes 35mins to run it on the clues grid and then the solution grid.
Can anyone think of a way to rewrite the code so it's quicker? Or are there some settings that could be changed so it handles better? I've changed the Display Performance settings to the bare minimum, but it only has a little effect.
Thanks for any help ... Nigel
rem Selects grid and fixes text
Set mySolPage = myDocumentA.Pages.Item(2)
For myCounter = 1 to mySolPage.TextFrames.Count
Set myTextFrame = mySolPage.TextFrames(myCounter)
myBounds = myTextFrame.GeometricBounds
If myBounds(0) > 35 and myBounds(1) > 5 and myBounds(2) < 240 and myBounds(3) < 210 Then
myTextFrame.Texts.Item(1).AppliedFont = "Tahoma"
myTextFrame.Texts.Item(1).fontstyle = "Bold"
myTextFrame.Texts.Item(1).baselineShift = 0
myTextFrame.textFramePreferences.VerticalJustification = idVerticalJustification.idCenterAlign
myTextFrame.textFramePreferences.ignoreWrap = 1
myTextFrame.textFramePreferences.firstBaselineOffset = idFirstBaseline.idAscentOffset
It would be much faster to use find/change to do the text formatting, or just apply a style to the crossword text and then edit the style as needed. There shouldn't be any need to select the text or text frames in this script.