#region Includes #include<file.au3> #include #include<./LotusNotes_UDF.au3> #Include <Excel.au3> #Endregion Includes #region Variables ;Variable Tableau pour stocker les données.. Global $Tab[1][1] ;Variables pour NOTES Global $RTELEM_TYPE_TABLE = 1 Global $RTELEM_TYPE_TABLECELL = 7 Global $RTELEM_TYPE_TEXTPARAGRAPH = 4 Global $RTELEM_TYPE_SECTION = 6 Dim $oSession Dim $document Dim $rtitem Dim $rtnavTable Dim $rtrangeCell Dim $rtnavCell Dim $rtnavflag Dim $rtt Dim $rtnav Dim $rtrangePara Dim $cellCounter #endregion ;---------------------------------------- ;Connexion à NOTES ;---------------------------------------- $oSession=CnxNotes() ;---------------------------------------- ;Connexion à la base ;---------------------------------------- $DB=DarabaseCnx($oSession) $Ws=ObjWSpace() ; Initialisation document $uidoc=$Ws.CurrentDocument $odoc = $uidoc.Document $rtitem=$odoc.GetFirstItem("Body") ;Accède à la première Table $rtnav = $rtitem.CreateNavigator $rtnav.FindFirstElement($RTELEM_TYPE_TABLE) $rtt = $rtnav.GetElement ;Initialisation du Navigator et des plages $rtnavTable = $rtitem.CreateNavigator $rtrangeCell = $rtitem.CreateRange $rtrangePara = $rtitem.CreateRange ;Première Cellule $rtnavTable.FindFirstElement($RTELEM_TYPE_TABLECELL) $rtRangeCell.SetBegin($rtnavTable) $rtRangeCell.SetEnd($rtnavTable) $rtnavCell = $rtRangeCell.Navigator ;Nb Lignes / Colonnes dans le tableau $nblignes = $rtt.RowCount $Nbcol = $rtt.ColumnCount ; Redimensionnement de l'Array ReDim $Tab[$nblignes+1][$Nbcol + 1 ] $Tab[0][0]=$nblignes $Tab[0][1]=$Nbcol ; On parcour les différentes cellules For $i = 1 To $nblignes ; Boucle Lignes For $j = 1 To $Nbcol ; Boucle Colonnes ;-------------------------------------------------- TrayTip("Progression..",$I & " / " & $nblignes & @CRLF & $J & " / " & $Nbcol & @CRLF ,100) ;-------------------------------------------------- $celltext = "" $cellCounter = $cellCounter + 1 ;-------------------------------------------------- ;' Premier paragraphe dans la cellule $rtnavCell.FindFirstElement($RTELEM_TYPE_TEXTPARAGRAPH) $rtRangePara.SetBegin($rtnavCell) $rtRangePara.SetEnd($rtnavCell) $celltext = $celltext & $rtRangePara.TextParagraph & @CRLF ;Récup de chaque paragraphe dans la cellule While $rtnavCell.FindNextElement($RTELEM_TYPE_TEXTPARAGRAPH) $rtRangePara.SetBegin($rtnavCell) $rtRangePara.SetEnd($rtnavCell) $celltext = $celltext & $rtRangePara.TextParagraph & @CRLF wend ConsoleWrite( @CRLF & ">> ------- Cell " & $cellCounter & " - " & $i & " - " & $j & @CRLF & $celltext & @CRLF & ">-----------------------------<" & @CRLF) ;Next Cellule $rtnavTable.FindNextElement($RTELEM_TYPE_TABLECELL) $rtrangeCell.SetBegin($rtnavTable) $rtnavCell = $rtrangeCell.Navigator ;-------------------------------------------------- $Tab[$I][$J] = $celltext Next Next ;Affichage du résultat.. _ArrayDisplay($Tab)
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question