I am having trouble trying to get a vbscript to work that attempts to logon
without the use of a dialog box. I am specifically using DTS withing SQL
Server, but I don't think that matters. My issue is when I set the dialog
property to False and provide a username and password, I do not get an error,
but the logon does not seem to be successful. If I allow the dialog to
appear and type the same password, it logs on properly and everything is
fine. I am using Outlook 2000 with NT4 SP5. Any ideas?
Thanks,
Dave
Sample script (from a DTS activeX script task)
Function Main()
mail_error = ReadTheMail
Main = DTSTaskExecResult_Success
End Function
Function ReadTheMail
stop
Set oOutlook = CreateObject("Outlook.application")
Set oNamespace = oOutlook.GetNamespace("MAPI")
oNamespace.Name = "KBraun"
'objnamespace.Logon "KBraun" , , True, True ' #1 - This works -
Prompts
for profile, type in password, and continues fine.
oNamespace.Logon "KBraun", "cccccccc", False, False ' #2 -
Continues past
this fine
' ***** msgbox objOutlook.Session ' Returns Mapi
msgbox oNamespace.CurrentUser.Name 'Get Unknown user with #2 / Get correct
name with #1
set oFolder = oNamespace.GetDefaultFolder(6) 'Get Error - This information
store could not be opened -2147221231
End Function
----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email ab...@newsone.net
Thanks,
Dave
'Try this code with #1 commented out
'Then try with #2 commented out
Set oOutlook = CreateObject("Outlook.application")
Set oNamespace = oOutlook.GetNamespace("MAPI")
' #1 - This works - Prompts for profile, type in password, and continues
fine.
'objnamespace.Logon "KBraun" , , True, True
' #2 -Continues past this fine
oNamespace.Logon "KBraun", "cccccccc", False, True
' ***** msgbox objOutlook.Session ' Returns Mapi
msgbox oNamespace.CurrentUser.Name 'Get Unknown user with #2 / Get
correct name with #1
set oFolder = oNamespace.GetDefaultFolder(6)
'Get Error with #2 - This information store could not be opened -2147221231
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
<david....@swagelok.com> wrote in message
news:9733dd$rfv$1...@news.netmar.com...
In my case I am logged onto the domain, say domain XXX, as xxx\dgabele. The
other account exists in the same domain say as xxx\kbraun. I set up a
Outlook profile for kbraun under the xxx domain on my machine (the one I am
logged on as xxx\dgabele).
Thanks,
Dave
In article <#EZnGQVnAHA.1356@tkmsftngp04>, Dmitry Streblechenko
----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
<david....@swagelok.com> wrote in message
news:975qh9$3go$1...@news.netmar.com...