Jump to content

rossati

Active Members
  • Posts

    37
  • Joined

  • Last visited

About rossati

  • Birthday 01/30/1942

Profile Information

  • Location
    Italy
  • WWW
    http://digilander.libero.it/bellecombe/
  • Interests
    Logic, trekking, programming

Recent Profile Visitors

440 profile views

rossati's Achievements

Seeker

Seeker (1/7)

4

Reputation

  1. Hello I would pass an array of object to OpenOffice API, but this fails, I think for incompatibility of array declaration. This is a ooBasic fragment that I would "convert" in AutoIt: ... Dim aProps(0) As New com.sun.star.beans.PropertyValue ' get configuration of the file history oCP = GetProcessServiceManager().createInstanceWithContext( _ "com.sun.star.configuration.ConfigurationProvider", GetDefaultContext() ) aProps(0).Name = "nodepath" aProps(0).Value = "/org.openoffice.Office.Common/History" oCUA = oCP.createInstanceWithArguments( _ "com.sun.star.configuration.ConfigurationUpdateAccess", aProps ) ... This Autoit fragment fails: Global $ooF = ObjCreate("com.sun.star.ServiceManager") $oCP = $ooF.createInstance("com.sun.star.configuration.ConfigurationProvider") Global $ooBeans[1] $ooBeans[0] = $ooF.createInstance("com.sun.star.beans.PropertyValue") $ooBeans[0].Name = "nodepath" $ooBeans[0].Value = "/org.openoffice.Office.Common/History" ; the underlying statement generates an error: (0x80020005) Type mismatch $oCUA =$oCP.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess", $ooBeans[0]) ; the underlying statement generates a syntax error: The requested action with this object has failed. msgbox(0,"",$ooBeans[0].Value) It is possible work around? Thanks John Rossati
  2. Hello I removed OpenOffice Portable and re-installed. Now it is working. John Rossati
  3. Thanks mLipock yes this is the case. My be the problem is because I have a LibreOffice portable application. John Rossati
  4. Hello I am trying to access a portable version of LibreOffice: Global $ooF = ObjCreate("com.sun.star.ServiceManager") This fails with the error description: 800401f3' Server.CreateObject Failed I have also registered a dll not present in OpenOffice (portable) folders. so_activex.dll Thanks John Rossati
  5. Thanks AutoBert, your suggestion is a good compromise. John Rossati
  6. Thanks Here a fragment rebuild from a complex form obtained by my form generator. ;================= Try Select Normale and Script =========================== #include <GUIConstantsEx.au3> $frm = GUICreate("Test big Combo Box", 260, 180) $cmbBox = GUICtrlCreateList("", 60, 40, 125, 21) GUICtrlSetData($cmbBox,'Acronimo HTML|Citazione|Contenuto cornice|Contenuto elenco|Contenuto tabella|Didascalia|Figure|Firma|Indirizzo destinatario' _ & '|Indirizzo HTML|Indirizzo mittente|Intestazione|Intestazione messaggio|Intestazione nota|Normale|Normale (Web)|Numero elenco|' _ & '|Numero elenco 2|Numero elenco 3|Numero elenco 4|Numero elenco 5|Numero pagina|Numero riga|OOoEmphasis|OOoMenuPath|OOoStrongEmphasis' _ & '|OOoTableText|Paragrafo elenco|Preformattato HTML|Primo rientro corpo del testo|Punti|Punto elenco|Rientro corpo del testo' _ & '|Rientro normale|Riferimento delicato|Riferimento intenso|Rimando commento|Rimando nota di chiusura|Salto a indice|Script' _ & '|Sfondo a colori||Soggetto commento|Sommario 1|Sottotitolo|Tabella|Tastiera HTML|Testo|Testo commento|Testo del blocco|Testo fumetto' _ & '|Testo macro|Testo non proporzionale|Testo normale|Testo nota di chiusura|Testo preformattato|Testo segnaposto|Testo sorgente|Titolo|Variabile') $txt = GUICtrlCreateInput("", 60, 64, 125, 21) $cmbFonts = GUICtrlCreateCombo("", 60, 90, 125, 21) GUICtrlSetData($cmbFonts,'Arial|Courier New|Times New Roman|Verdana') $idBTN = GUICtrlCreateButton("Close", 85, 145, 80, 25) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE,$idBTN MsgBox(0,"",GUICtrlRead($txt)) ExitLoop Case $cmbBox GUICtrlSetData($txt, GUICtrlRead($txt) & "," & GUICtrlRead($cmbBox)) EndSwitch WEnd Some words of explication: I need to select one or some styles which are inserted on a text. It is perfectly possible to choose only what I want as long as I don't use arrows that practically function as the enter key or mouse click I think there is no solution with standard library. John Rossati
  7. Hello Thanks to all. JLogan3o13 your script introduced me some useful features, however does not solve my problem: I have a great combo (the styles of a word document); from this combo I have to choose one or more styles that is, each chosen from the combo is queued in a text field. Unfortunately surfing the combo with arrows generates a choice and I don't think there's no way to differentiate DOWN, UP from ENTER (or click). John Rossati
  8. Hello I have a little problem with combo box i.e. I need to capture the choice only when a mouse or enter key are pressed. Therefore the choice is fired even when the list is traversed by the navigation arrows. There is the possibility to test if the choice is per keybord enter or mouse click? Thanks
  9. Hello The style property, unlike what occurs in Word Basic, it is an object, to which the style name is contained in the property NameLocal. This is the working code: #include <MsgBoxConstants.au3> #include <Word.au3> ; Create application object Local $oRange, $oWord = _Word_Create() Local $oMyError = ObjEvent("AutoIt.Error", "ErrFunc") ; Install a custom error handler $oWord = _Word_Create() Global $sDocument = "C:\D\Condor\Documentazioni e Progetti\ContextIndexMS\cIndex.doc" $oDoc = _Word_DocOpen($oWord, $sDocument) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocRangeSet Example", _ "Error opening document." & @CRLF & "@error = " & @error & ", @extended = " & @extended) $oParag = $oWord.ActiveDocument.Paragraphs $nParag = $oParag.count For $i = 1 To $nParag $style = $oParag($i).Style.NameLocal ConsoleWrite($style & @TAB & $oParag($i).Range.Text & @CRLF) Next ; ***************************************************************************** MsgBox($MB_SYSTEMMODAL, "", "See you later alligator.") Func ErrFunc() ; This is a custom error handler $sHexNumber = Hex($oMyError.number, 8) MsgBox($MB_OK, "", "We intercepted a COM Error at line " & $oMyError.scriptline & @CRLF & _ "Number is: " & $sHexNumber & @CRLF & _ "WinDescription is: " & $oMyError.windescription) EndFunc ;==>ErrFunc
  10. Hello I would create a KWIC (Key Word in Context) index, and for this I need to access to a paragraph style. But the style returned is empty. I realized this function as Word macro without problems (If anyone is interested can download it from www.condorinformatique.com). Here is a fragment I used: $oWord = _Word_Create() Global $sDocument = "C:\D\Condor\Documentazioni e Progetti\ContextIndexMS\cIndex.doc" $oDoc = _Word_DocOpen($oWord, $sDocument) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocRangeSet Example", _ "Error opening '.\Extras\Test.doc'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) $oParag = $oWord.ActiveDocument.Paragraphs $nParag = $oParag.count For $i = 1 To $nParag $style = $oParag($i).Range.ParagraphStyle ConsoleWrite($i & " * *** " & $style & @CRLF) ; ConsoleWrite($oParag($i).Range.Text & @CRLF) Next ; ***************************************************************************** MsgBox($MB_SYSTEMMODAL, "", "See you later alligator.")This is due to the different treatment of variant variables between Autoit and Basic? Thanks for any idea John Rossati
  11. Hello Thank Water, I used your script It works enough well, but it loops on a paragraph, my be becaus after there is a table. Best regards wordContextIndex.au3 cIndex.doc
  12. Thanks AdmiralAlkex You got me a solution: a child GUI. My problem is to drop a lot of controls (for compact my form generator), and a child which can be 'camouflaged ' in another GUI is a solution. John Rossati
  13. I am working on a new Window, but it seems me there are a lot of problems, first I can create a new window, but it seems that GUISwitch does not work, i.e. the handle returned from _WinAPI_CreateWindowEx is not the same type of the handle returned from GUICreate: $iStyle = $WS_POPUP $sClass = "Autoit v3 GUI" $sName = "" $iX = 110 $iY = 140 $iWidth = 200 $iHeight = 200 $hw = _WinAPI_CreateWindowEx($iExStyle, $sClass, $sName, $iStyle, $iX, $iY, $iWidth, $iHeight, $hWind) GUISwitch($hw) So I can't add widgets, set background color etc. John Rossati
  14. Thanks to all An Id array is what I handle actually, the tab would be very good, it can be deleted with all inside controls, but a tab item control without text drafts a rectangle but don't host controls inside. John Rossati
×
×
  • Create New...