VBA/Excel/Access/Word/Outlook/Outlook — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 19:33, 26 мая 2010
declare the object variable myOutlook and then assign to it a reference to an Outlook.Application object:
<source lang="vb">
Sub obj()
Dim myOutlook As Object Set myOutlook = CreateObject("Outlook.Application")
End Sub
</source>
The GetOutlook Function
<source lang="vb">
Function GetOutlook() As Outlook.NameSpace
Dim objOutlook As New Outlook.Application Dim objNamespace As Outlook.NameSpace Dim strProfile As String Dim strPassword As String strProfile = "A" strPassword = "mypassword" Set objNamespace = objOutlook.GetNamespace("MAPI") Call objNamespace.Logon(strProfile, _ strPassword, False, True) Set GetOutlook = objNamespace
End Function
</source>