well, is not what i had in mind, but it could be a good alternative method.
i searched over Google that macro and i found it here:
http://www.mail-archive.com/users@es.op ... 01456.htmlit seems that the code is this one:
- Code: Select all Expand viewCollapse view
REM ***** BASIC *****
Sub ListarPalabrasIncorrectas
Dim oDocModel as Variant
Dim oTextCursor as Variant
Dim oLinguSvcMgr as Variant
Dim oSpellChk as Variant
Dim oListDocFrame as Variant
Dim oListDocModel as Variant
Dim sListaPalabras as String
Dim aProp(0) As New com.sun.star.beans.PropertyValue
' Obtener acceso al documento actual
oDocModel = StarDesktop.CurrentFrame.Controller.getModel()
If IsNull(oDocModel) Then
MsgBox("No hay ningún documento activo." + Chr(13) + _
"Abra un documento de Writer antes de activar esta
macro.")
Exit Sub
End If
' Verificar que este sea un documento de texto
If Not HasUnoInterfaces (oDocModel, "com.sun.star.text.XTextDocument")
Then
MsgBox("Este documento no soporta la interfaz 'XTextDocument'."
+ Chr(13) + _
"Utilice esta macro únicamente con documentos de
Writer.")
Exit Sub
End If
' Obtener un cursor de texto y posicionarlo al principio del documento
oTextCursor = oDocModel.Text.createTextCursor()
oTextCursor.gotoStart(False)
' Obtener una referencia al corrector ortográfico o morir en el intento
oLinguSvcMgr =
createUnoService("com.sun.star.linguistic2.LinguServiceManager")
If Not IsNull(oLinguSvcMgr) Then
oSpellChk = oLinguSvcMgr.getSpellChecker()
End If
If IsNull (oSpellChk) Then
MsgBox("No se pudo acceder a un corrector ortográfico." +
Chr(13) + _
"Verifique las opciones de lingüística de su
instalación.")
Exit Sub
End If
' Iterar sobre todas las palabras que contiene el documento
Do
If oTextCursor.isStartOfWord() Then
oTextCursor.gotoEndOfWord(True)
' Verificar si la palabra está bien escrita
If Not oSpellChk.isValid(oTextCursor.getString(),
oTextCursor.getPropertyValue("CharLocale"), aProp()) Then
sListaPalabras = sListaPalabras +
oTextCursor.getString() + Chr(13)
End If
oTextCursor.collapseToEnd()
End If
Loop While oTextCursor.gotoNextWord(False)
If Len(sListaPalabras) = 0 Then
MsgBox("No hay errores ortográficos en el documento.")
Exit Sub
End If
' Buscar el frame que contiene la lista (o crearlo)
oListDocFrame = StarDesktop.findFrame("fListarPalabrasIncorrectas",
com.sun.star.frame.FrameSearchFlag.ALL)
If IsNull(oListDocFrame) Then
oListDocModel =
StarDesktop.loadComponentFromURL("private:factory/swriter",
"fListarPalabrasIncorrectas", com.sun.star.frame.FrameSearchFlag.CREATE,
aProp())
oListDocFrame = oListDocModel.CurrentController.getFrame()
Else
oListDocModel = oListDocFrame.Controller.getModel()
End If
' Obtener un cursor de texto para este documento
oTextCursor = oListDocModel.Text.createTextCursor()
oTextCursor.gotoEnd(False)
' Escribir la lista
oListDocModel.Text.insertString (oTextCursor, sListaPalabras, False)
' Activar este frame
oListDocFrame.activate()
' ¡Y ya terminamos!
End Sub
i pasted the code in my edit macro window (Alt+F11 -> Edit)
then i opened a file with some text inside it and i tried to execute the macro.
unfortunately i get a sintax error that points to this line:
"Abra un documento de Writer antes de activar esta
macro."
would you please make a test to see if you have the same crash i have?
unfortunately the macro was written in spanish so i don't understand many words inside it
however it seems that other users had the same problem with it:
http://www.mail-archive.com/users@es.op ... 01466.html