本帖最后由 502762378 于 2012-3-21 09:18 编辑
你试试#include <AD.au3>
_AD_Open()
$Title = "电子邮件帐户"
If WinActivate($Title) Then
ControlSetText($Title, "", "RichEdit20WPT1", "whex101" );设定exchange server
ControlSetText($Title, "", "RichEdit20WPT2", @UserName )
EndIf
ControlClick($Title, "", "Button2")
;MsgBox(1,1,_displayName())
While ControlGetText($Title, "", "RichEdit20WPT2")
If ControlGetText($Title, "", "RichEdit20WPT2") = _displayName() Then
ControlClick($Title, "", "Button14")
ExitLoop
EndIf
Sleep(100)
WEnd
Func _displayName()
$aProperties = _AD_GetObjectProperties(@UserName)
For $n =1 To $aProperties[0][0]
If $aProperties[$n][0] = "displayname" Then $displaynameName = $aProperties[$n][1];解析出的邮箱名
Next
Return $displaynameName
EndFunc
_AD_Close()
|