A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Does redemption require user to be logged on?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 26th 06, 08:59 PM posted to microsoft.public.outlook.program_addins
dcook23
external usenet poster
 
Posts: 4
Default Does redemption require user to be logged on?

I have created a script that uses SMTP to send an email off a
designated server and then uses redemption to check if the message has
arrived in the specified mailbox. The script is being automatically
kicked off by a monitoring product and running under an account that
has an Outlook profile setup. The script works great if the account is
logged on to the machine no matter if Outlook is already open or not.
If the account is not logged on then the script will not continue
beyond the line below.

set Inbox = Session.GetDefaultFolder(olFolderInbox)

I have tried to trap an error message but nothing after the line above
is executed but the script exits. My question is does redemption
require the user account be logged in?

The full piece of my code that is using redemption is below.
Const olFolderInbox = 6
set Session = CreateObject("Redemption.RDOSession")
Session.Logon

set Inbox = Session.GetDefaultFolder(olFolderInbox)
for each Msg in Inbox.Items
for each att in msg.Attachments
If lcase(left(att.filename,4)) = "fax-" Then
If DateDiff("n",msg.ReceivedTime,FaxSentTime)
5 Then
vSuccess = "yes"
End If
End If
Next
msg.delete
Next

  #2  
Old September 26th 06, 09:07 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Does redemption require user to be logged on?

RDOSession does require a logon or an assignment of MAPIOBJECT. I would
check for Session.LoggedOn after the Logon call to verify that the session
is truly logged on.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"dcook23" wrote in message
ups.com...
I have created a script that uses SMTP to send an email off a
designated server and then uses redemption to check if the message has
arrived in the specified mailbox. The script is being automatically
kicked off by a monitoring product and running under an account that
has an Outlook profile setup. The script works great if the account is
logged on to the machine no matter if Outlook is already open or not.
If the account is not logged on then the script will not continue
beyond the line below.

set Inbox = Session.GetDefaultFolder(olFolderInbox)

I have tried to trap an error message but nothing after the line above
is executed but the script exits. My question is does redemption
require the user account be logged in?

The full piece of my code that is using redemption is below.
Const olFolderInbox = 6
set Session = CreateObject("Redemption.RDOSession")
Session.Logon

set Inbox = Session.GetDefaultFolder(olFolderInbox)
for each Msg in Inbox.Items
for each att in msg.Attachments
If lcase(left(att.filename,4)) = "fax-" Then
If DateDiff("n",msg.ReceivedTime,FaxSentTime)
5 Then
vSuccess = "yes"
End If
End If
Next
msg.delete
Next


  #3  
Old September 26th 06, 11:34 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Does redemption require user to be logged on?

Do you mean whether it makes any difference which Windows user identity your
code is running under? Of course, RDOSession.Logon will try to log to the
default profile, which clearly depends on who the user is. It is possible
that the current user (e.g. local service account) does not have any
profiles at all. Or (if you are impersonating a user), the HKCU registry
hive (where the profile are stored) for that user are not loaded.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"dcook23" wrote in message
ups.com...
I have created a script that uses SMTP to send an email off a
designated server and then uses redemption to check if the message has
arrived in the specified mailbox. The script is being automatically
kicked off by a monitoring product and running under an account that
has an Outlook profile setup. The script works great if the account is
logged on to the machine no matter if Outlook is already open or not.
If the account is not logged on then the script will not continue
beyond the line below.

set Inbox = Session.GetDefaultFolder(olFolderInbox)

I have tried to trap an error message but nothing after the line above
is executed but the script exits. My question is does redemption
require the user account be logged in?

The full piece of my code that is using redemption is below.
Const olFolderInbox = 6
set Session = CreateObject("Redemption.RDOSession")
Session.Logon

set Inbox = Session.GetDefaultFolder(olFolderInbox)
for each Msg in Inbox.Items
for each att in msg.Attachments
If lcase(left(att.filename,4)) = "fax-" Then
If DateDiff("n",msg.ReceivedTime,FaxSentTime)
5 Then
vSuccess = "yes"
End If
End If
Next
msg.delete
Next



  #4  
Old September 27th 06, 10:43 PM posted to microsoft.public.outlook.program_addins
dcook23
external usenet poster
 
Posts: 4
Default Does redemption require user to be logged on?

Thank you for the reply.

The monitoring product that executing the script is executing it using
a run as so it is running using the credentials of the account that has
the Outlook profile configured. Is this not enough to load the hive
where the profile is stored?

Would using the MAPIOBJECT make any difference?


Dmitry Streblechenko wrote:
Do you mean whether it makes any difference which Windows user identity your
code is running under? Of course, RDOSession.Logon will try to log to the
default profile, which clearly depends on who the user is. It is possible
that the current user (e.g. local service account) does not have any
profiles at all. Or (if you are impersonating a user), the HKCU registry
hive (where the profile are stored) for that user are not loaded.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"dcook23" wrote in message
ups.com...
I have created a script that uses SMTP to send an email off a
designated server and then uses redemption to check if the message has
arrived in the specified mailbox. The script is being automatically
kicked off by a monitoring product and running under an account that
has an Outlook profile setup. The script works great if the account is
logged on to the machine no matter if Outlook is already open or not.
If the account is not logged on then the script will not continue
beyond the line below.

set Inbox = Session.GetDefaultFolder(olFolderInbox)

I have tried to trap an error message but nothing after the line above
is executed but the script exits. My question is does redemption
require the user account be logged in?

The full piece of my code that is using redemption is below.
Const olFolderInbox = 6
set Session = CreateObject("Redemption.RDOSession")
Session.Logon

set Inbox = Session.GetDefaultFolder(olFolderInbox)
for each Msg in Inbox.Items
for each att in msg.Attachments
If lcase(left(att.filename,4)) = "fax-" Then
If DateDiff("n",msg.ReceivedTime,FaxSentTime)
5 Then
vSuccess = "yes"
End If
End If
Next
msg.delete
Next


  #5  
Old September 27th 06, 11:36 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Does redemption require user to be logged on?

Did you try to specify an explicit profile name when calling
RDOSession.Logon? How did you trap the error?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"dcook23" wrote in message
oups.com...
Thank you for the reply.

The monitoring product that executing the script is executing it using
a run as so it is running using the credentials of the account that has
the Outlook profile configured. Is this not enough to load the hive
where the profile is stored?

Would using the MAPIOBJECT make any difference?


Dmitry Streblechenko wrote:
Do you mean whether it makes any difference which Windows user identity
your
code is running under? Of course, RDOSession.Logon will try to log to the
default profile, which clearly depends on who the user is. It is possible
that the current user (e.g. local service account) does not have any
profiles at all. Or (if you are impersonating a user), the HKCU registry
hive (where the profile are stored) for that user are not loaded.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"dcook23" wrote in message
ups.com...
I have created a script that uses SMTP to send an email off a
designated server and then uses redemption to check if the message has
arrived in the specified mailbox. The script is being automatically
kicked off by a monitoring product and running under an account that
has an Outlook profile setup. The script works great if the account is
logged on to the machine no matter if Outlook is already open or not.
If the account is not logged on then the script will not continue
beyond the line below.

set Inbox = Session.GetDefaultFolder(olFolderInbox)

I have tried to trap an error message but nothing after the line above
is executed but the script exits. My question is does redemption
require the user account be logged in?

The full piece of my code that is using redemption is below.
Const olFolderInbox = 6
set Session = CreateObject("Redemption.RDOSession")
Session.Logon

set Inbox = Session.GetDefaultFolder(olFolderInbox)
for each Msg in Inbox.Items
for each att in msg.Attachments
If lcase(left(att.filename,4)) = "fax-" Then
If DateDiff("n",msg.ReceivedTime,FaxSentTime)
5 Then
vSuccess = "yes"
End If
End If
Next
msg.delete
Next




  #6  
Old September 27th 06, 11:51 PM posted to microsoft.public.outlook.program_addins
dcook23
external usenet poster
 
Posts: 4
Default Does redemption require user to be logged on?

I tried specifying the profile name and I get the same results.

I have also tried trapping an error with no luck. I setup the script to
create a log file when it runs. The logon code looks like this to do my
logging:

' Use redemption to logon to default MAPI profile
set Session = CreateObject("Redemption.RDOSession")
objFile.writeline "going to logon"
Session.Logon
ObjFile.writeline "post logon"
objFile.writeline session.loggedon

If I have the user account logged into the server when the monitoring
product kicks off the script I get the following written to my log:

going to logon
post logon
True

If the user account is not logged onto the machine when the script
kicks off I get only the line that says "going to logon" and nothing
more. I have also tried using "On Error Resume Next" before the logon
even and then writing err.number immediately after logon. That results
in 0 when the account is logged on and nothing is writen after "going
to logon" when the account is not logged on. It appears the script
exits at the "Session.Logon" if the account is not logged on.

Does this make sense? Does anyone know if I should be able to get this
to work without having the account logged in?

I very much appreciate the help.


Dmitry Streblechenko wrote:
Did you try to specify an explicit profile name when calling
RDOSession.Logon? How did you trap the error?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"dcook23" wrote in message
oups.com...
Thank you for the reply.

The monitoring product that executing the script is executing it using
a run as so it is running using the credentials of the account that has
the Outlook profile configured. Is this not enough to load the hive
where the profile is stored?

Would using the MAPIOBJECT make any difference?


Dmitry Streblechenko wrote:
Do you mean whether it makes any difference which Windows user identity
your
code is running under? Of course, RDOSession.Logon will try to log to the
default profile, which clearly depends on who the user is. It is possible
that the current user (e.g. local service account) does not have any
profiles at all. Or (if you are impersonating a user), the HKCU registry
hive (where the profile are stored) for that user are not loaded.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"dcook23" wrote in message
ups.com...
I have created a script that uses SMTP to send an email off a
designated server and then uses redemption to check if the message has
arrived in the specified mailbox. The script is being automatically
kicked off by a monitoring product and running under an account that
has an Outlook profile setup. The script works great if the account is
logged on to the machine no matter if Outlook is already open or not.
If the account is not logged on then the script will not continue
beyond the line below.

set Inbox = Session.GetDefaultFolder(olFolderInbox)

I have tried to trap an error message but nothing after the line above
is executed but the script exits. My question is does redemption
require the user account be logged in?

The full piece of my code that is using redemption is below.
Const olFolderInbox = 6
set Session = CreateObject("Redemption.RDOSession")
Session.Logon

set Inbox = Session.GetDefaultFolder(olFolderInbox)
for each Msg in Inbox.Items
for each att in msg.Attachments
If lcase(left(att.filename,4)) = "fax-" Then
If DateDiff("n",msg.ReceivedTime,FaxSentTime)
5 Then
vSuccess = "yes"
End If
End If
Next
msg.delete
Next



  #7  
Old September 28th 06, 07:15 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Does redemption require user to be logged on?

Hmmm.. Is that a PST or an Exchange mailbox?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"dcook23" wrote in message
oups.com...
I tried specifying the profile name and I get the same results.

I have also tried trapping an error with no luck. I setup the script to
create a log file when it runs. The logon code looks like this to do my
logging:

' Use redemption to logon to default MAPI profile
set Session = CreateObject("Redemption.RDOSession")
objFile.writeline "going to logon"
Session.Logon
ObjFile.writeline "post logon"
objFile.writeline session.loggedon

If I have the user account logged into the server when the monitoring
product kicks off the script I get the following written to my log:

going to logon
post logon
True

If the user account is not logged onto the machine when the script
kicks off I get only the line that says "going to logon" and nothing
more. I have also tried using "On Error Resume Next" before the logon
even and then writing err.number immediately after logon. That results
in 0 when the account is logged on and nothing is writen after "going
to logon" when the account is not logged on. It appears the script
exits at the "Session.Logon" if the account is not logged on.

Does this make sense? Does anyone know if I should be able to get this
to work without having the account logged in?

I very much appreciate the help.


Dmitry Streblechenko wrote:
Did you try to specify an explicit profile name when calling
RDOSession.Logon? How did you trap the error?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"dcook23" wrote in message
oups.com...
Thank you for the reply.

The monitoring product that executing the script is executing it using
a run as so it is running using the credentials of the account that has
the Outlook profile configured. Is this not enough to load the hive
where the profile is stored?

Would using the MAPIOBJECT make any difference?


Dmitry Streblechenko wrote:
Do you mean whether it makes any difference which Windows user
identity
your
code is running under? Of course, RDOSession.Logon will try to log to
the
default profile, which clearly depends on who the user is. It is
possible
that the current user (e.g. local service account) does not have any
profiles at all. Or (if you are impersonating a user), the HKCU
registry
hive (where the profile are stored) for that user are not loaded.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"dcook23" wrote in message
ups.com...
I have created a script that uses SMTP to send an email off a
designated server and then uses redemption to check if the message
has
arrived in the specified mailbox. The script is being automatically
kicked off by a monitoring product and running under an account that
has an Outlook profile setup. The script works great if the account
is
logged on to the machine no matter if Outlook is already open or
not.
If the account is not logged on then the script will not continue
beyond the line below.

set Inbox = Session.GetDefaultFolder(olFolderInbox)

I have tried to trap an error message but nothing after the line
above
is executed but the script exits. My question is does redemption
require the user account be logged in?

The full piece of my code that is using redemption is below.
Const olFolderInbox = 6
set Session = CreateObject("Redemption.RDOSession")
Session.Logon

set Inbox = Session.GetDefaultFolder(olFolderInbox)
for each Msg in Inbox.Items
for each att in msg.Attachments
If lcase(left(att.filename,4)) = "fax-" Then
If DateDiff("n",msg.ReceivedTime,FaxSentTime)

5 Then
vSuccess = "yes"
End If
End If
Next
msg.delete
Next





 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Redemption and hiding user in exchange from address lists [email protected] Outlook and VBA 8 August 7th 06 07:53 PM
User logged in on several systems Charles MacLean Outlook - Installation 0 June 1st 06 02:30 AM
Outlook Interop COM Exception When Logged in as Windows Standard User [email protected] Add-ins for Outlook 0 April 27th 06 01:34 AM
Possible to require e-mail be read? Chase Outlook and VBA 1 March 27th 06 06:37 AM
Possible to require e-mail be read? Chase Outlook - Using Forms 0 March 27th 06 12:50 AM


All times are GMT +1. The time now is 11:36 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.