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