N
nacooke
Hi
I have two exchange accounts open at once (my personal account and a
shared account). When I send messages from the shared account the
message is stored in "Sent Items" of my personal account. As I would
like these mails to be stored in the "Sent Items" of the shared
account I wrote some code to do move the sent item: (this is an
extract of the code)
Private Sub objSentItems_ItemAdd(ByVal Item As Object)
'Fired when something is added to personal "Sent Mail" folder
If TypeName(Item) = "MailItem" Then
If Item.SentOnBehalfOfName = "Shared Account" Then
Set DestinationFolder =
Application.Session.GetFolderFromID(SentEntryID, SentStoreID)
Item.Move (DestinationFolder)
End If
End If
End Sub
This works fine on my PC and one of my colleague's, however another
colleague's PC displays the security alert ("A program is trying to
access e-mail addresses stored in Outlook. Do you want to allow
this?").
The line that appears to be generating is "If Item.SentOnBehalfOfName
= "Shared Account" Then".
All three PCs are Outlook 2003.
Any ideas on what could be causing this behaviour?
Many thanks
N A Cooke
I have two exchange accounts open at once (my personal account and a
shared account). When I send messages from the shared account the
message is stored in "Sent Items" of my personal account. As I would
like these mails to be stored in the "Sent Items" of the shared
account I wrote some code to do move the sent item: (this is an
extract of the code)
Private Sub objSentItems_ItemAdd(ByVal Item As Object)
'Fired when something is added to personal "Sent Mail" folder
If TypeName(Item) = "MailItem" Then
If Item.SentOnBehalfOfName = "Shared Account" Then
Set DestinationFolder =
Application.Session.GetFolderFromID(SentEntryID, SentStoreID)
Item.Move (DestinationFolder)
End If
End If
End Sub
This works fine on my PC and one of my colleague's, however another
colleague's PC displays the security alert ("A program is trying to
access e-mail addresses stored in Outlook. Do you want to allow
this?").
The line that appears to be generating is "If Item.SentOnBehalfOfName
= "Shared Account" Then".
All three PCs are Outlook 2003.
Any ideas on what could be causing this behaviour?
Many thanks
N A Cooke