So wie ich das verstehe muss die angegebene "Data Source" mit "odbcad32" definiert werden.
Beiträge von water
-
-
Durchsuch das Forum mal nach "Oracle". Da kriegst Du eine ganze Liste an Ergebnissen z.B. das hier .
-
Hallo Dino,
hier ein erster Versuch. Doku etc. noch unvollständig aber die Beispiele funktionieren.
Die Beispiele durchsuchen die Inbox nach den in den Variablen $sStringx angegebenen Inhalten. Bitte einfach diese Variablen für Deine Umgebung anpassen.Spoiler anzeigen
[autoit]#AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
[/autoit] [autoit][/autoit] [autoit]
#AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y
#include <OutlookEX.au3>
$iOL_Debug = 2; *****************************************************************************
[/autoit] [autoit][/autoit] [autoit]
; Create test environment
; *****************************************************************************
Global $oOutlook = _OL_Open()
If @error Then Exit MsgBox(16, "OutlookEX UDF - _OL_ItemSearch Example Script", "Error running _OL_Open. @error = " & @error & ", @extended = " & @extended)
;Global $iResult = _OL_TestEnvironmentCreate($oOutlook)
;If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF - Manage Test Environment", "Error creating the test environment. @error = " & @error)
Global $aFolder = _OL_FolderAccess($oOutlook, "", $olFolderInbox)
If @error Then Exit MsgBox(16, "OutlookEX UDF - _OL_ItemSearch Example Script", "Error running _OL_Open. @error = " & @error & ", @extended = " & @extended); *****************************************************************************
[/autoit] [autoit][/autoit] [autoit]
; Example 1
; Search the subject of mail items containing $sString1 or
; starting with $sString2
; Returns: Subject, CreationTime, Sendername
; *****************************************************************************
Global $sString1 = "nicht", $sString2 = "DEMI"
Global $aSearchArray[3][4] = [[2, 4],[0x0037001E, 3, $sString1, "or"],["subject", 2, $sString2, ""]]
Global $aResult = _OL_ItemSearch($oOutlook, $aFolder[1], $olMail, $aSearchArray, "subject,CreationTime,Sendername")
If @error Then
MsgBox(16, "OutlookEX UDF - _OL_ItemSearch Example Script", "Error running _OL_ItemSearch. @error = " & @error & ", @extended = " & @extended)
Else
_Arraydisplay($aResult, "Example 1")
EndIf; *****************************************************************************
[/autoit] [autoit][/autoit] [autoit]
; Example 2
; Same as example 1 but filter specified in DASL format
; Returns: EntryID, Subject, CreationTime, Sendername
; *****************************************************************************
Global $sFilter = "@SQL=""http://schemas.microsoft.com/mapi/proptag/0x0037001E"" ci_phrasematch '" & $sString1 & "' or ""http://schemas.microsoft.com/mapi/proptag/0x0037001E"" ci_startswith '" & $sString2 & "'"
$aResult = _OL_ItemSearch($oOutlook, $aFolder[1], $olMail, $sFilter, "EntryID,Subject,CreationTime,Sendername")
If @error Then
MsgBox(16, "OutlookEX UDF - _OL_ItemSearch Example Script", "Error running _OL_ItemSearch. @error = " & @error & ", @extended = " & @extended)
Else
_Arraydisplay($aresult, "Example 2")
EndIf; *****************************************************************************
[/autoit] [autoit][/autoit] [autoit]
; Example 3
; Search the subject of mail items with exact matching $sString3
; Returns: EntryID, Subject
; *****************************************************************************
Global $sString3 = "cert"
Global $aSearchArray[2][4] = [[1, 4],[0x0037001E, 1, $sString3]]
$aResult = _OL_ItemSearch($oOutlook, $aFolder[1], $olMail, $aSearchArray, "EntryID,Subject")
If @error Then
MsgBox(16, "OutlookEX UDF - _OL_ItemSearch Example Script", "Error running _OL_ItemSearch. @error = " & @error & ", @extended = " & @extended)
Else
_Arraydisplay($aresult, "Example 3")
EndIf; *****************************************************************************
[/autoit] [autoit][/autoit] [autoit]
; Example 4
; Search the body of mail items for phrase $sString4
; Returns: EntryID, Subject, max 255 characters of the body
; *****************************************************************************
Global $sString4 = "Kamera"
$sFilter = "@SQL=""urn:schemas:httpmail:textdescription"" ci_phrasematch '" & $sString4 & "'"
$aResult = _OL_ItemSearch($oOutlook, $aFolder[1], $olMail, $sFilter, "EntryID,Subject,urn:schemas:httpmail:textdescription")
If @error Then
MsgBox(16, "OutlookEX UDF - _OL_ItemSearch Example Script", "Error running _OL_ItemSearch. @error = " & @error & ", @extended = " & @extended)
Else
_Arraydisplay($aresult, "Example 4")
EndIf_OL_Close($oOutlook)
[/autoit] [autoit][/autoit] [autoit]
Exit; #FUNCTION# ====================================================================================================================
[/autoit] [autoit][/autoit] [autoit]
; Name ..........: _OL_ItemSearch
; Description ...: Find items (extended search) using a DASL query returning an array of all specified properties.
; Syntax.........: _OL_ItemSearch($oOL, $vOL_Folder, $iOL_ObjectClass, $avOL_Search, $sOL_ReturnProperties[, $sOL_Sort = ""[, $iOL_Flags = 0]])
; Parameters ....: $oOL - Outlook object returned by a preceding call to _OL_Open()
; $vOL_Folder - Folder object as returned by _OL_FolderAccess or full name of folder where the search will be started.
; +If you want to search a default folder you have to specify the folder object.
; $iOL_ObjectClass - Class of items to search for. Defined by the Outlook OlObjectClass enumeration (default = Default = $olContact)
; $avOL_Search - Can bei either a string containing the full DASL query or a one based two-dimensional array with unlimited number of rows containing the elements to build the DASL query:
; |0: Property to query. This can be either the hex value or the name of the property. The function transaltes the name to the hex value. Unknown names set @error
; |1: Type of comparison operator: 1 = "=", 2 = "ci_startswith", 3 = "ci_phrasematch", 3 = "like"
; |2: Value to search for
; |3: Operator to concatenate the next comparison. Has to be "and", "or", "or not" or "and not"
; For details please see Remarks
; $sOL_ReturnProperties - Comma separated list of properties to return. Can be the property name (e.g. "subject") or the MAPI proptag (e.g. "http://schemas.microsoft.com/mapi/proptag/0x10F4000B")
; $sOL_Sort - Optional: Property to sort the result on plus optional flag to sort descending (default = None). E.g. "[Subject], True" sorts the result descending on the subject
; $iOL_Flags - Optional: Flags to set different processing options. Can be a combination of the following:
; |1: Subfolders will be included
; |2: Row 1 contains column headings. Therefore the number of rows/columns in the table has to be calculated using UBound
; |4: Just return the number of records. You don't get an array, just a single integer denoting the total number of records found
; Return values .: Success - One based two-dimensional array with the properties specified by $sOL_ReturnProperties
; Failure - Returns "" and sets @error:
; |1 - $oOL is not an object
; |2 - Error accessing the specified folder. See @extended for errorcode returned by _OL_FolderAccess
; |3 - $iOL_ObjectClass is not an integer
; |4 - $avOL_Search is an array but not a two dimensional array or the first row doesn't contain the numbers of rows and columns
; |5 - $sOL_ReturnProperties is empty
; |6 - Specified search property could not be translated to a hex code. @extended is set to the row in $avOL_Search
; |7 - Specified search operator is not an integer or < 1 or > 3. @extended is set to the row in $avOL_Search
; |8 - Specified search value is empty. @extended is set to the row in $avOL_Search
; |9 - Error splitting $sOL_ReturnProperties
; |10 - Error adding $sOL_ReturnProperties to the result set. @extended is the number of the property in error
; |11 - Invalid search operator. Must be "and" or "or". @extended is set to the row in $avOL_Search
; |12 - The last entry in the search array has a search operator
; |13 - The entry in the search array has no operator but more search arguments follow
; |14 - Error executing the search operation. @extended is set to the error returned by method GetTable
; |15 - No records returned by the search operation
; Author ........: water
; Modified ......:
; Remarks .......: DASL syntax: "Searching Outlook Data" - http://msdn.microsoft.com/en-us/library/cc513841.aspx"
; List of MAPI proptags: - http://www.dimastr.com/redemption/enum_MAPITags.htm
; Related .......:
; Link ..........:
; Example .......: Yes
; ===============================================================================================================================
Func _OL_ItemSearch($oOL, $vOL_Folder, $iOL_ObjectClass, $avOL_Search, $sOL_ReturnProperties);, $sOL_Sort = "", $iOL_Flags = 0)Local $asOL_Operator[5] = [4, "=", "ci_startswith", "ci_phrasematch", "like"]
[/autoit] [autoit][/autoit] [autoit]
Local $sOL_Filter = '@SQL=', $aOL_Temp, $sOL_Property, $iOL_Rows, $iOL_Cols, $oOL_Row
If Not IsObj($oOL) Then Return SetError(1, 0, "")
If Not IsObj($vOL_Folder) Then
$aOL_Temp = _OL_FolderAccess($oOL, $vOL_Folder)
If @error Then Return SetError(2, @error, "")
$vOL_Folder = $aOL_Temp[1]
EndIf
If Not IsInt($iOL_ObjectClass) Then Return SetError(3, 0, "")
If StringStripWs($sOL_ReturnProperties, 7) = "" Then Return SetError(5, 0, "")
Local $aOL_ReturnProperties = StringSplit(StringStripWS($sOL_ReturnProperties, 8), ",")
If @error Then Return SetError(9, 0, "")
; Build search string
If IsArray($avOL_Search) Then
If UBound($avOL_Search, 0) <> 2 Or Not IsInt($avOL_Search[0][0]) Or Not IsInt($avOL_Search[0][1]) Then Return SetError(4, 0, "")
Local Const $sPropTag = "http://schemas.microsoft.com/mapi/proptag/"
For $iOL_Index = 1 To $avOL_Search[0][0]
If IsInt($avOL_Search[$iOL_Index][0]) Then
$sOL_Property = "0x" & Hex(Int($avOL_Search[$iOL_Index][0]))
Else
$sOL_Property = __OL_Property2Hex($avOL_Search[$iOL_Index][0])
If @error Then Return SetError(6, $iOL_Index, "")
Endif
If Not IsInt($avOL_Search[$iOL_Index][1]) Or $avOL_Search[$iOL_Index][1] < 1 Or $avOL_Search[$iOL_Index][1] > 3 Then Return SetError(7, $iOL_Index, "")
$avOL_Search[$iOL_Index][2] = StringStripWS($avOL_Search[$iOL_Index][2], 7)
If $avOL_Search[$iOL_Index][2] = "" Then Return SetError(8, $iOL_Index, "")
$avOL_Search[$iOL_Index][3] = StringStripWS($avOL_Search[$iOL_Index][3], 7)
If $avOL_Search[$iOL_Index][3] <> "" Then
If $avOL_Search[$iOL_Index][3] <> "and" And $avOL_Search[$iOL_Index][3] <> "or" And _
$avOL_Search[$iOL_Index][3] <> "and not" And $avOL_Search[$iOL_Index][3] <> "or not" _
Then Return SetError(11, $iOL_Index, "")
If $iOL_Index = $avOL_Search[0][0] Then Return SetError(12, $iOL_Index, "")
Else
If $iOL_Index < $avOL_Search[0][0] Then Return SetError(13, $iOL_Index, "")
EndIf
$sOL_Filter = $sOL_Filter & '"' & $sPropTag & $sOL_Property & '" ' & $asOL_Operator[$avOL_Search[$iOL_Index][1]] & " '" & $avOL_Search[$iOL_Index][2] & "'"
If $avOL_Search[$iOL_Index][3] <> "" Then $sOL_Filter = $sOL_Filter & " " & $avOL_Search[$iOL_Index][3] & " "
Next
Else
$sOL_Filter = $avOL_Search
EndIf
; execute the search
Local $oOL_Table = $vOL_Folder.GetTable($sOL_Filter)
If @error Or Not IsObj($oOL_Table) Then Return SetError(14, @error, "")
If $oOL_Table.GetRowCount = 0 Then Return SetError(15, 0, "")
; http://msdn.microsoft.com/en-us/library/…fice.12%29.aspx
; Remove all columns in the default column set
$oOL_Table.Columns.RemoveAll
; Specify desired properties
For $iOL_Index = 1 To $aOL_ReturnProperties[0]
$oOL_Table.Columns.Add($aOL_ReturnProperties[$iOL_Index])
If @error Then Return SetError(10, $iOL_Index, "")
Next
; Create and fill the result table
$iOL_Rows = $oOL_Table.GetRowCount + 1
If @error Then Return SetError(14, @error, "")
$iOL_Cols = $aOL_ReturnProperties[0]
Local $avOL_Result[$iOL_Rows][$iOL_Cols] = [[$iOL_Rows - 1, $iOL_Cols]]
Local $iOL_Index2 = 1
While Not $oOL_Table.EndOfTable
$oOL_Row = $oOL_Table.GetNextRow
For $iOL_Index = 1 To $aOL_ReturnProperties[0]
$avOL_Result[$iOL_Index2][$iOL_Index-1] = $oOL_Row($aOL_ReturnProperties[$iOL_Index])
Next
$iOL_Index2 = $iOL_Index2 + 1
WEnd
Return $avOL_ResultEndFunc ;==>_OL_ItemSearch
[/autoit] [autoit][/autoit] [autoit]Func __OL_Property2Hex($sOL_Property)
[/autoit] [autoit][/autoit] [autoit]Local $aProperties[100][2] = [[2, 2],["subject", "0x0037001E"],["SenderName","0x0C1A001F"]]
[/autoit] [autoit][/autoit] [autoit]
For $i = 1 To $aProperties[0][0]
If $aProperties[$i][0] = $sOL_Property Then Return $aProperties[$i][1]
Next
Return SetError(1, 0, "")EndFunc ;==>__OL_Property2Hex
[/autoit] -
Für Skripte die ich in Produktion verwende - oder wie ein anderer User meinte: für "ernsthafte Skripte" - verwende ich auch nur die aktuelle stabile Version.
Aber es ist immer gut zu wissen, wo die Reise hingeht und dann spiele ich nicht ungern auch schon mal mit 'ner Beta rum um zu sehen, ob das dann auch funktioniert
Grüße vom Bodensee -
Und du kannst Objekt-Fehler nicht mit "If @error..." abfangen. Diese Aufgabe übernimmt ja der Error-Handler.
Ab 3.3.9.2 schon. Sagt zumindest trancexx. Und die muss es wissen, pinselt sie ja an dieser Stelle im Source Code rum
-
peethebee hat ein schönes Buch zu AutoIt (fast fertig) geschrieben.
Auf english gibt es tutorials ohne Ende - wie es mit deutschen Unterlagen aussieht, kann ich nicht genau sagen. -
Lass Dein Script mal mit der aktuellen beta Version 3.3.9.2 laufen. Da gibt es kein crashen mehr mit der Meldung "The requested action with this object has failed".
Das Skript soll dann immer korrekt weiterlaufen und nur das Makro @error setzen. Ein COM error handler ist damit nicht mehr notwendig und erleichtert die ganze Geschichte. -
Wenn Du Office in der 32-bit Version installiert hast, dann musst Du Deine AutoIt Skripte auch für 32-bit kompilieren, unabhängig ob das OS 64- oder 32-bit läuft.
Sonst gibt's Probleme bezüglich COM. -
Ich hätte noch ein paar andere Verbesserungen. Wenn ich das in Deinen Code einbaue, dann brauche ich meine Änderungen nicht zu markieren bzw. Du sie nicht wieder mühsam in Deinen Code einbauen.
-
Mal sehen.
Hast Du das Skript schon um die Auswahl nach Abteilung erweitert? Falls ja, poste den aktuellen Code oder schick mir ne PM, dann baue ich auf diesem Code auf. -
Bei uns ist auch von Interesse, wann sich die Leute zuletzt angemeldet haben.
Wir haben das über das Login-Skript gelöst. Das trägt einfach in eine Datei (je Benutzer) Datum/Uhrzeit ein - fertig. -
Wegen der Replikationsproblematik gibt es die Funktion _AD_GetLastLoginDate. Sie fragt alle DCs der Domäne nach dem lastlogin und gibt das aktuellste zurück.
Durch diese Problematik und die Menge der DCs kann es natürlich zu erheblichen Laufzeiten kommen.
Nur einen DC abzufragen bringt da leider nichts. -
Der LDAP Query liefert Dir eine zwei-dimensionale Tabelle. Die musst Du nach 2 Kriterien sortieren und dann in die Excel-Datei schreiben.
Es gibt irgendwo eine UDF um eine 2D-Tabelle nach mehreren Kriterien zu sortieren. Ich suche mal ... hier. -
Ich habe unser Telefonbuch nach Excel exportiert. Die Spalten lassen sich leichter formatieren und mehr Hilfe bei Fragen kriegt man zu Excel auch als zu Word.
Auf Seite 1 habe ich sogar das Formenlogo positioniert etc. -
Klar, geht mit function GUICtrlCreatePic.
-
Hallo Dino,
sollte mir mal fad sein, dann versuche ich mich mal an einer erweiterten Suchfunktion (Strg+Shift+F).
Mal sehen.Schöne Grüße
water -
Die Buttons "I" und "T" funktionieren nicht, da Du sie in der Schleife nicht abfragst. Das muss analog zu
[autoit]Case $hBTN_Help
[/autoit]
_Help()erfolgen.
Um ENTER verwenden zu können füge bitte folgenden Code vor
[autoit]GUISetState(@SW_SHOW)
[/autoit]ein:
[autoit]; Set accelerators for Enter
[/autoit]
Local $AccelKeys[1][2] = [["{ENTER}",$hBtn_OK]]
GUISetAccelerators($AccelKeys) -
Poste mal das komplette Statement.
-
Für Firmennetzwerke die mit Microsofts Active Directory (AD) als zentralem Repository arbeiten.
Damit kannst Du Informationen aus dem AD auslesen, Benutzer anlegen ... -
Experimentelle Version 1.2.1.0 ist freigegeben.
Nur für Tests!
Benötigt AutoIt 3.3.9.2 beta wegen der Änderungen in der Handhabung von COM Fehlern!Für download siehe bitte den Link in meiner Signatur.