你可以再试一下:
Dim oApp As New Outlook.Application
Dim ProfileName as string="****"
Dim UserPwd as string="****"
oApp.Session.Logon ProfileName,UserPwd
看一下这样是否还会弹出要求输入用户名,密码,
域名的验证对话框。
</tr>
</xsl:for-each>
</TBODY>
</table>
</xsl:template>
</xml>
<script language=vbscript>
Dim oXMLHTTP
Dim xmlDoc
Sub cmdListItems_OnClick()
strURL = document.all.URL.Value
if strURL = "" then
msgbox "You must enter a valid URL"
exit sub
end if
'Check to see if URL has HTTP:// in the beginning
if UCASE(Left(strURL,7)) <> "HTTP://" then
msgbox "The application is adding HTTP:// to your URL."
strURL = "HTTP://" & strURL
document.all.URL.Value = strURL
end if
Sub XMLHTTPStateChange
dim errText
if (oXMLHTTP.readystate <> 4) then
exit sub
end if
if(oXMLHTTP.status <> 207) then
xsldest.innerText = "Error, status = " & CStr(oXMLHTTP.status) & " " & oXMLHTTP.statusText
errText = "Error!"
else
document.all.XMLResponse.value = oXMLHTTP.ResponseText
if errText = "" then
document.all.XMLStatus.value = oXMLHTTP.status & " " & oXMLHTTP.statusText
else
document.all.XMLStatus.value = errText
end if
Set xmlDoc = oXMLHTTP.responseXML
xsldest.innerHTML = xmlDoc.transformNode(calxsl.documentElement)
end if
End Sub
Sub CheckDebugging
if document.all.ShowDebugging.checked = True then
'Show the debugging text areas
'Either style below works. Depends on which one you like better
document.all.item("DebuggingDiv").style.display = ""
else
document.all.DebuggingDiv.style.display = "none"
end if
End Sub
用winform来创建outlook对象操作的话也可以,其实还是通过MAPI来访问Ex服务器的,具体的要不出现登陆对话框的话,你需要给当前创建的Outlook对象指定一个profile,通过该profile来实现登陆操作。
我给你一个代码样例:
Reference:Microsoft Office 10.0 object Library
Microsoft Outlook 10.0 object Library
Dim oApp As New Outlook.Application
dim ProfileName as string'你在客户机上创建一个profile,制定一个用户名和密码来打开
outlook就可以了
oApp.Session.Logon ProfileName
......后面就是你对oApp进行操作的部分了。
Public Function GetStorageName() As String
' Return the name of the storage for
' the current server, using ADSI and the AD.
' The return value is in the format:
' file://.backofficestorage/<domainname>/
' Turn on error trapping for VB and VBS
On Error Resume Next
Dim SysInfo As ActiveDs.ADSystemInfo
Dim strName As String
' Reference the ADSystemInfo object in the
Set SysInfo = New ActiveDs.ADSystemInfo
' Get the domain name
strName = SysInfo.DomainDNSName
If Len(strName) <> 0 Then
' Build the generic part of the EXOLEDB string
GetStorageName = "file://./backofficestorage/" & strName & "/"
Else
' Problem accessing the AD
Err.Raise vbObjectError + 1959, "Unable to retrieve domain name."
End If