H
Harry Betlem
Hi there,
As I refer to, I am having a slight problem in sending an e-mail from Access 97,
with the use of Outlook 97.
Things do run as they should, if I stick to the "CurrentUser" in Outlook(97)
But...
I want the e-mails to be sent under the name of another user.
I made another profile, and now I want to check weather OL is running under the
CurrentUser Profile,
if so, change the profile to the other User, and send the mail.
Afterwards, set the user back to Current user.
I tried this... but I think it could be done better, quicker
Code snippet:
Set objOutlook = CreateObject("Outlook.Application")
Set nsOutlook = objOutlook.GetNamespace("MAPI")
If nsOutlook.CurrentUser = "Harry Betlem" Then
nsOutlook.Logoff '(This seemed Not enough)
nsOutlook.Application.Quit
Set nsOutlook = objOutlook.GetNamespace("MAPI")
nsOutlook.Logon "Shadow Record", "", False, True
Else
nsOutlook.Logon "Shadow Record", "", False, True
End If
End code snippet
Any help welcome
Harry Betlem
(e-mail address removed)
As I refer to, I am having a slight problem in sending an e-mail from Access 97,
with the use of Outlook 97.
Things do run as they should, if I stick to the "CurrentUser" in Outlook(97)
But...
I want the e-mails to be sent under the name of another user.
I made another profile, and now I want to check weather OL is running under the
CurrentUser Profile,
if so, change the profile to the other User, and send the mail.
Afterwards, set the user back to Current user.
I tried this... but I think it could be done better, quicker
Code snippet:
Set objOutlook = CreateObject("Outlook.Application")
Set nsOutlook = objOutlook.GetNamespace("MAPI")
If nsOutlook.CurrentUser = "Harry Betlem" Then
nsOutlook.Logoff '(This seemed Not enough)
nsOutlook.Application.Quit
Set nsOutlook = objOutlook.GetNamespace("MAPI")
nsOutlook.Logon "Shadow Record", "", False, True
Else
nsOutlook.Logon "Shadow Record", "", False, True
End If
End code snippet
Any help welcome
Harry Betlem
(e-mail address removed)