Robert Moore wrote:
It should not matter..... Check to see if this modified routine runs faster. I added "lockControllers" and "unlockControllers", which should prevent screen updates. Again, this should NOT crash and if it does, then it is probably a bug. I will run this at work today under windows and see what happens.Everyone, especially Pitonyak,
Thanks again, your version was much more efficient than mine. I have a new question in relation to this, now. I've run the script, and at first it was running VERY slowly because I hadn't turned-off the automatic spell checker, and now that I've turned it off, I get it running faster. The problem is that the script seems to die after a set amount of hard time, meaning actual seconds or minutes. I have about 4,000+ fonts on my system and I want to print them all out in a couple columns and see them all on paper to pick out the ones I like best.
Without the spell checker, it gets to around the 1900'th line(font) and then stops. Before that it was getting to around the 1300'th line. I don't get any errors to report, the cursor just sort of sits at the end of the document blinking rapidly, as if it were processing, the script seems to execute for another 10 seconds without any actual output and then finally quits.
Is there a hard-coded time limit build into OOo Basic scripts? It stops at around the same font (at the same font?) every time, but two different fonts for when I do and don't have auto spell check on, so I don't think it's any specific font fouling it up. OOo recognizes all of my fonts, and I can pick them all manually in the menu bar, but this is what I really want. Just to remind anyone reading this, I'm using OOo 1.9.79 on Windows XP SP1. I have 512MB Ram and a P4-M at 2.2GHz.
Thank you,
Rob Moore
------------------------------------------------
"The legitimate powers of government extend only to such acts as are
injurious to others. But it does me no injury for my neighbor to say there
are 20 gods, or no God. It neither picks my pocket nor breaks my leg."
-Thomas Jefferson
Sub ListFonts Dim oWindow 'The container window supports the awt XDevice interface. Dim oDescript 'Array of awt FontDescriptor structures. Dim i% 'General index variable. Dim s$ 'General string variable. Dim sFontName$ 'Name of one font. Dim sLastFont$
ThisComponent.lockControllers()
oWindow = ThisComponent.getCurrentController().getFrame().getContainerWindow()
oDescript = oWindow.getFontDescriptors()
For i = LBound(oDescript) to UBound(oDescript)
sFontName = oDescript(i).Name
If sFontName <> sLastFont Then
sLastFont = sFontName
s = "My Demo Text - " & sFontName
InsertSimpleText(s, sFontName)
End If
Next
ThisComponent.unlockControllers()
End Sub-- Andrew Pitonyak My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm Free Info: http://www.pitonyak.org/oo.php
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
