WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Setting Send-From Account in VBA

 
Goto page 1, 2, 3
   Home -> Office -> Programming VBA RSS
Next:  Adressing subfolder - and copy contact ?  
Author Message
Josh

External


Since: Oct 23, 2008
Posts: 12



(Msg. 1) Posted: Thu Oct 23, 2008 7:25 am
Post subject: Setting Send-From Account in VBA
Archived from groups: microsoft>public>outlook>program_vba (more info?)

Like many other posters I've seen, I sometimes send mail from the
wrong account in Outlook 2007. I wanted to create a macro that when I
sent a message, would prompt me to verify the sending account, and let
me change if necessary.

I have the following code:
Private Sub Application_ItemSend(ByVal item As Object, Cancel As
Boolean)

If TypeOf item Is Outlook.MailItem Then
'Show form that displays account list and sets
item.SendUsingAccount

'To debug, verify it's using the right account:
msgbox item.SendUsingAccount
End if

End Sub

The routine works in the sense that it displays the list of accounts,
and sets the item.SendUsingAccount value properly (the messagebox
displays the correct value). However, it goes through and sends the
mail from the originally selected account anyways. It seems like once
you get to the ItemSend event, it's too late to change the account for
the current message if it gets sent. However, if something interrupts
the sending process (like another check for having a subject that
could set cancel = TRUE and cancel the sending, or stepping through
the code in debug mode), it will actually update the sending account
(which I can see reflected in the message window, cause it didn't
actually send).

My question is... is there any way to update the SendUsingAccount
property once you get to the ItemSend event? If not, is there an
earlier place to trap this event? Is there a way to trap the event of
clicking the send button and then running this code?

Thanks in advance.
Back to top
Login to vote
Josh

External


Since: Oct 23, 2008
Posts: 12



(Msg. 2) Posted: Thu Oct 23, 2008 9:50 am
Post subject: Re: Setting Send-From Account in VBA [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Oct 23, 11:09 am, "Jan Hyde (VB MVP)"
<StellaDrin....DeleteThis@REMOVE.ME.uboot.com> wrote:
> Josh <jgordon....DeleteThis@gmail.com>'s wild thoughts were released on
> Thu, 23 Oct 2008 07:25:02 -0700 (PDT) bearing the following
> fruit:
>
>
>
> >Like many other posters I've seen, I sometimes send mail from the
> >wrong account in Outlook 2007. I wanted to create a macro that when I
> >sent a message, would prompt me to verify the sending account, and let
> >me change if necessary.
>
> >I have the following code:
> >Private Sub Application_ItemSend(ByVal item As Object, Cancel As
> >Boolean)
>
> >If TypeOf item Is Outlook.MailItem Then
> >   'Show form that displays account list and sets
> >item.SendUsingAccount
>
> >   'To debug, verify it's using the right account:
> >    msgbox item.SendUsingAccount
> >End if
>
> >End Sub
>
> >The routine works in the sense that it displays the list of accounts,
> >and sets the item.SendUsingAccount value properly (the messagebox
> >displays the correct value). However, it goes through and sends the
> >mail from the originally selected account anyways. It seems like once
> >you get to the ItemSend event, it's too late to change the account for
> >the current message if it gets sent. However, if something interrupts
> >the sending process (like another check for having a subject that
> >could set cancel = TRUE and cancel the sending, or stepping through
> >the code in debug mode), it will actually update the sending account
> >(which I can see reflected in the message window, cause it didn't
> >actually send).
>
> >My question is... is there any way to update the SendUsingAccount
> >property once you get to the ItemSend event? If not, is there an
> >earlier place to trap this event? Is there a way to trap the event of
> >clicking the send button and then running this code?
>
> >Thanks in advance.
>
> Why not set 'Cancel' yourself, set the properties you want
> to change and resend.
>
> You'll need some sort of flag to prevent being prompted on
> the resend of course.
>
> --
> Jan Hyde (VB MVP)
>
> https://mvp.support.microsoft.com/profile/Jan.Hyde

Well, that's what I had to settle for. I now just display a message
"Are you sure you want to send from account: ACCOUNT_NAME" OK/Cancel.
However, I was wondering if there was a more elegant solution.

As a follow-up, is there a way to know if a message is a new message
or a reply/forward? I don't really need to perform this check if I'm
simply replying to a message, it's more important for a new message.

Thanks,
Josh
Back to top
Login to vote
JP

External


Since: Nov 20, 2007
Posts: 556



(Msg. 3) Posted: Thu Oct 23, 2008 10:30 am
Post subject: Re: Setting Send-From Account in VBA [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

There are a couple of threads on the issue, and I can't locate them at
the moment, but I believe the consensus was you needed to use
Redemption to do this. I can try to locate them if you really want an
accurate answer.

Regarding your followup question, you would need to check the
ConversationIndex to see if there is an existing message. See
http://www.outlookcode.com/codedetail.aspx?id=1714 for code sample. As
an alternative, you could check if Left$(MailItem.Subject, 3) = "RE:"

HTH,
JP


On Oct 23, 12:50 pm, Josh <jgordon....TakeThisOut@gmail.com> wrote:
> On Oct 23, 11:09 am, "Jan Hyde (VB MVP)"
>
>
>
>
>
> <StellaDrin....TakeThisOut@REMOVE.ME.uboot.com> wrote:
> > Josh <jgordon....TakeThisOut@gmail.com>'s wild thoughts were released on
> > Thu, 23 Oct 2008 07:25:02 -0700 (PDT) bearing the following
> > fruit:
>
> > >Like many other posters I've seen, I sometimes send mail from the
> > >wrong account in Outlook 2007. I wanted to create a macro that when I
> > >sent a message, would prompt me to verify the sending account, and let
> > >me change if necessary.
>
> > >I have the following code:
> > >Private Sub Application_ItemSend(ByVal item As Object, Cancel As
> > >Boolean)
>
> > >If TypeOf item Is Outlook.MailItem Then
> > >   'Show form that displays account list and sets
> > >item.SendUsingAccount
>
> > >   'To debug, verify it's using the right account:
> > >    msgbox item.SendUsingAccount
> > >End if
>
> > >End Sub
>
> > >The routine works in the sense that it displays the list of accounts,
> > >and sets the item.SendUsingAccount value properly (the messagebox
> > >displays the correct value). However, it goes through and sends the
> > >mail from the originally selected account anyways. It seems like once
> > >you get to the ItemSend event, it's too late to change the account for
> > >the current message if it gets sent. However, if something interrupts
> > >the sending process (like another check for having a subject that
> > >could set cancel = TRUE and cancel the sending, or stepping through
> > >the code in debug mode), it will actually update the sending account
> > >(which I can see reflected in the message window, cause it didn't
> > >actually send).
>
> > >My question is... is there any way to update the SendUsingAccount
> > >property once you get to the ItemSend event? If not, is there an
> > >earlier place to trap this event? Is there a way to trap the event of
> > >clicking the send button and then running this code?
>
> > >Thanks in advance.
>
> > Why not set 'Cancel' yourself, set the properties you want
> > to change and resend.
>
> > You'll need some sort of flag to prevent being prompted on
> > the resend of course.
>
> > --
> > Jan Hyde (VB MVP)
>
> >https://mvp.support.microsoft.com/profile/Jan.Hyde
>
> Well, that's what I had to settle for. I now just display a message
> "Are you sure you want to send from account: ACCOUNT_NAME" OK/Cancel.
> However, I was wondering if there was a more elegant solution.
>
> As a follow-up, is there a way to know if a message is a new message
> or a reply/forward? I don't really need to perform this check if I'm
> simply replying to a message, it's more important for a new message.
>
> Thanks,
> Josh- Hide quoted text -
>
> - Show quoted text -
Back to top
Login to vote
Dmitry Streblechenko

External


Since: Nov 23, 2003
Posts: 1123



(Msg. 4) Posted: Thu Oct 23, 2008 11:23 am
Post subject: Re: Setting Send-From Account in VBA [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Look at the ConversationIndex property - for new messages it will be 44
characters long (22 byte for the raw PR_CONVERSATION_INDEX binary property).

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"JP" <jp2112.DeleteThis@earthlink.net> wrote in message
news:2deca1b0-d765-44fe-917a-ba69b387dc58@h60g2000hsg.googlegroups.com...
There are a couple of threads on the issue, and I can't locate them at
the moment, but I believe the consensus was you needed to use
Redemption to do this. I can try to locate them if you really want an
accurate answer.

Regarding your followup question, you would need to check the
ConversationIndex to see if there is an existing message. See
http://www.outlookcode.com/codedetail.aspx?id=1714 for code sample. As
an alternative, you could check if Left$(MailItem.Subject, 3) = "RE:"

HTH,
JP


On Oct 23, 12:50 pm, Josh <jgordon....DeleteThis@gmail.com> wrote:
> On Oct 23, 11:09 am, "Jan Hyde (VB MVP)"
>
>
>
>
>
> <StellaDrin....DeleteThis@REMOVE.ME.uboot.com> wrote:
> > Josh <jgordon....DeleteThis@gmail.com>'s wild thoughts were released on
> > Thu, 23 Oct 2008 07:25:02 -0700 (PDT) bearing the following
> > fruit:
>
> > >Like many other posters I've seen, I sometimes send mail from the
> > >wrong account in Outlook 2007. I wanted to create a macro that when I
> > >sent a message, would prompt me to verify the sending account, and let
> > >me change if necessary.
>
> > >I have the following code:
> > >Private Sub Application_ItemSend(ByVal item As Object, Cancel As
> > >Boolean)
>
> > >If TypeOf item Is Outlook.MailItem Then
> > > 'Show form that displays account list and sets
> > >item.SendUsingAccount
>
> > > 'To debug, verify it's using the right account:
> > > msgbox item.SendUsingAccount
> > >End if
>
> > >End Sub
>
> > >The routine works in the sense that it displays the list of accounts,
> > >and sets the item.SendUsingAccount value properly (the messagebox
> > >displays the correct value). However, it goes through and sends the
> > >mail from the originally selected account anyways. It seems like once
> > >you get to the ItemSend event, it's too late to change the account for
> > >the current message if it gets sent. However, if something interrupts
> > >the sending process (like another check for having a subject that
> > >could set cancel = TRUE and cancel the sending, or stepping through
> > >the code in debug mode), it will actually update the sending account
> > >(which I can see reflected in the message window, cause it didn't
> > >actually send).
>
> > >My question is... is there any way to update the SendUsingAccount
> > >property once you get to the ItemSend event? If not, is there an
> > >earlier place to trap this event? Is there a way to trap the event of
> > >clicking the send button and then running this code?
>
> > >Thanks in advance.
>
> > Why not set 'Cancel' yourself, set the properties you want
> > to change and resend.
>
> > You'll need some sort of flag to prevent being prompted on
> > the resend of course.
>
> > --
> > Jan Hyde (VB MVP)
>
> >https://mvp.support.microsoft.com/profile/Jan.Hyde
>
> Well, that's what I had to settle for. I now just display a message
> "Are you sure you want to send from account: ACCOUNT_NAME" OK/Cancel.
> However, I was wondering if there was a more elegant solution.
>
> As a follow-up, is there a way to know if a message is a new message
> or a reply/forward? I don't really need to perform this check if I'm
> simply replying to a message, it's more important for a new message.
>
> Thanks,
> Josh- Hide quoted text -
>
> - Show quoted text -
Back to top
Login to vote
Josh

External


Since: Oct 23, 2008
Posts: 12



(Msg. 5) Posted: Thu Oct 23, 2008 12:07 pm
Post subject: Re: Setting Send-From Account in VBA [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Oct 23, 2:23 pm, "Dmitry Streblechenko" <dmi... DeleteThis @dimastr.com> wrote:
> Look at the ConversationIndex property - for new messages it will be 44
> characters long (22 byte for the raw PR_CONVERSATION_INDEX binary property).
>
> --
> Dmitry Streblechenko (MVP)http://www.dimastr.com/
> OutlookSpy  - Outlook, CDO
> and MAPI Developer Tool
> -"JP" <jp2... DeleteThis @earthlink.net> wrote in message
>
> news:2deca1b0-d765-44fe-917a-ba69b387dc58@h60g2000hsg.googlegroups.com...
> There are a couple of threads on the issue, and I can't locate them at
> the moment, but I believe the consensus was you needed to use
> Redemption to do this. I can try to locate them if you really want an
> accurate answer.
>
> Regarding your followup question, you would need to check the
> ConversationIndex to see if there is an existing message. Seehttp://www.outlookcode.com/codedetail.aspx?id=1714for code sample. As
> an alternative, you could check if Left$(MailItem.Subject, 3) = "RE:"
>
> HTH,
> JP
>
> On Oct 23, 12:50 pm, Josh <jgordon... DeleteThis @gmail.com> wrote:
>
> > On Oct 23, 11:09 am, "Jan Hyde (VB MVP)"
>
> > <StellaDrin... DeleteThis @REMOVE.ME.uboot.com> wrote:
> > > Josh <jgordon... DeleteThis @gmail.com>'s wild thoughts were released on
> > > Thu, 23 Oct 2008 07:25:02 -0700 (PDT) bearing the following
> > > fruit:
>
> > > >Like many other posters I've seen, I sometimes send mail from the
> > > >wrong account in Outlook 2007. I wanted to create a macro that when I
> > > >sent a message, would prompt me to verify the sending account, and let
> > > >me change if necessary.
>
> > > >I have the following code:
> > > >Private Sub Application_ItemSend(ByVal item As Object, Cancel As
> > > >Boolean)
>
> > > >If TypeOf item Is Outlook.MailItem Then
> > > > 'Show form that displays account list and sets
> > > >item.SendUsingAccount
>
> > > > 'To debug, verify it's using the right account:
> > > > msgbox item.SendUsingAccount
> > > >End if
>
> > > >End Sub
>
> > > >The routine works in the sense that it displays the list of accounts,
> > > >and sets the item.SendUsingAccount value properly (the messagebox
> > > >displays the correct value). However, it goes through and sends the
> > > >mail from the originally selected account anyways. It seems like once
> > > >you get to the ItemSend event, it's too late to change the account for
> > > >the current message if it gets sent. However, if something interrupts
> > > >the sending process (like another check for having a subject that
> > > >could set cancel = TRUE and cancel the sending, or stepping through
> > > >the code in debug mode), it will actually update the sending account
> > > >(which I can see reflected in the message window, cause it didn't
> > > >actually send).
>
> > > >My question is... is there any way to update the SendUsingAccount
> > > >property once you get to the ItemSend event? If not, is there an
> > > >earlier place to trap this event? Is there a way to trap the event of
> > > >clicking the send button and then running this code?
>
> > > >Thanks in advance.
>
> > > Why not set 'Cancel' yourself, set the properties you want
> > > to change and resend.
>
> > > You'll need some sort of flag to prevent being prompted on
> > > the resend of course.
>
> > > --
> > > Jan Hyde (VB MVP)
>
> > >https://mvp.support.microsoft.com/profile/Jan.Hyde
>
> > Well, that's what I had to settle for. I now just display a message
> > "Are you sure you want to send from account: ACCOUNT_NAME" OK/Cancel.
> > However, I was wondering if there was a more elegant solution.
>
> > As a follow-up, is there a way to know if a message is a new message
> > or a reply/forward? I don't really need to perform this check if I'm
> > simply replying to a message, it's more important for a new message.
>
> > Thanks,
> > Josh- Hide quoted text -
>
> > - Show quoted text -

The length=44 for ConversationIndex worked like a charm. Thanks!

I'm not familiar with redemption and a quick search didn't reveal
anything too helpful. Would you mind posting an example?

Thanks,
Josh
Back to top
Login to vote
Dmitry Streblechenko

External


Since: Nov 23, 2003
Posts: 1123



(Msg. 6) Posted: Thu Oct 23, 2008 3:14 pm
Post subject: Re: Setting Send-From Account in VBA [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You don't have to use Redemption for that. MailItem exposes the
ConversationIndex property as well.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Josh" <jgordon428 DeleteThis @gmail.com> wrote in message
news:3cf8168c-d4cd-42cb-b459-85f3c0725266@26g2000hsk.googlegroups.com...
On Oct 23, 2:23 pm, "Dmitry Streblechenko" <dmi... DeleteThis @dimastr.com> wrote:
> Look at the ConversationIndex property - for new messages it will be 44
> characters long (22 byte for the raw PR_CONVERSATION_INDEX binary
> property).
>
> --
> Dmitry Streblechenko (MVP)http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
> -"JP" <jp2... DeleteThis @earthlink.net> wrote in message
>
> news:2deca1b0-d765-44fe-917a-ba69b387dc58@h60g2000hsg.googlegroups.com...
> There are a couple of threads on the issue, and I can't locate them at
> the moment, but I believe the consensus was you needed to use
> Redemption to do this. I can try to locate them if you really want an
> accurate answer.
>
> Regarding your followup question, you would need to check the
> ConversationIndex to see if there is an existing message.
> Seehttp://www.outlookcode.com/codedetail.aspx?id=1714for code sample. As
> an alternative, you could check if Left$(MailItem.Subject, 3) = "RE:"
>
> HTH,
> JP
>
> On Oct 23, 12:50 pm, Josh <jgordon... DeleteThis @gmail.com> wrote:
>
> > On Oct 23, 11:09 am, "Jan Hyde (VB MVP)"
>
> > <StellaDrin... DeleteThis @REMOVE.ME.uboot.com> wrote:
> > > Josh <jgordon... DeleteThis @gmail.com>'s wild thoughts were released on
> > > Thu, 23 Oct 2008 07:25:02 -0700 (PDT) bearing the following
> > > fruit:
>
> > > >Like many other posters I've seen, I sometimes send mail from the
> > > >wrong account in Outlook 2007. I wanted to create a macro that when I
> > > >sent a message, would prompt me to verify the sending account, and
> > > >let
> > > >me change if necessary.
>
> > > >I have the following code:
> > > >Private Sub Application_ItemSend(ByVal item As Object, Cancel As
> > > >Boolean)
>
> > > >If TypeOf item Is Outlook.MailItem Then
> > > > 'Show form that displays account list and sets
> > > >item.SendUsingAccount
>
> > > > 'To debug, verify it's using the right account:
> > > > msgbox item.SendUsingAccount
> > > >End if
>
> > > >End Sub
>
> > > >The routine works in the sense that it displays the list of accounts,
> > > >and sets the item.SendUsingAccount value properly (the messagebox
> > > >displays the correct value). However, it goes through and sends the
> > > >mail from the originally selected account anyways. It seems like once
> > > >you get to the ItemSend event, it's too late to change the account
> > > >for
> > > >the current message if it gets sent. However, if something interrupts
> > > >the sending process (like another check for having a subject that
> > > >could set cancel = TRUE and cancel the sending, or stepping through
> > > >the code in debug mode), it will actually update the sending account
> > > >(which I can see reflected in the message window, cause it didn't
> > > >actually send).
>
> > > >My question is... is there any way to update the SendUsingAccount
> > > >property once you get to the ItemSend event? If not, is there an
> > > >earlier place to trap this event? Is there a way to trap the event of
> > > >clicking the send button and then running this code?
>
> > > >Thanks in advance.
>
> > > Why not set 'Cancel' yourself, set the properties you want
> > > to change and resend.
>
> > > You'll need some sort of flag to prevent being prompted on
> > > the resend of course.
>
> > > --
> > > Jan Hyde (VB MVP)
>
> > >https://mvp.support.microsoft.com/profile/Jan.Hyde
>
> > Well, that's what I had to settle for. I now just display a message
> > "Are you sure you want to send from account: ACCOUNT_NAME" OK/Cancel.
> > However, I was wondering if there was a more elegant solution.
>
> > As a follow-up, is there a way to know if a message is a new message
> > or a reply/forward? I don't really need to perform this check if I'm
> > simply replying to a message, it's more important for a new message.
>
> > Thanks,
> > Josh- Hide quoted text -
>
> > - Show quoted text -

The length=44 for ConversationIndex worked like a charm. Thanks!

I'm not familiar with redemption and a quick search didn't reveal
anything too helpful. Would you mind posting an example?

Thanks,
Josh
Back to top
Login to vote
Josh

External


Since: Oct 23, 2008
Posts: 12



(Msg. 7) Posted: Thu Oct 23, 2008 3:48 pm
Post subject: Re: Setting Send-From Account in VBA [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Oct 23, 6:14 pm, "Dmitry Streblechenko" <dmi....DeleteThis@dimastr.com> wrote:
> You don't have to use Redemption for that. MailItem exposes the
> ConversationIndex property as well.
>
> --
> Dmitry Streblechenko (MVP)http://www.dimastr.com/
> OutlookSpy  - Outlook, CDO
> and MAPI Developer Tool
> -"Josh" <jgordon....DeleteThis@gmail.com> wrote in message
>
> news:3cf8168c-d4cd-42cb-b459-85f3c0725266@26g2000hsk.googlegroups.com...
> On Oct 23, 2:23 pm, "Dmitry Streblechenko" <dmi....DeleteThis@dimastr.com> wrote:
>
>
>
> > Look at the ConversationIndex property - for new messages it will be 44
> > characters long (22 byte for the raw PR_CONVERSATION_INDEX binary
> > property).
>
> > --
> > Dmitry Streblechenko (MVP)http://www.dimastr.com/
> > OutlookSpy - Outlook, CDO
> > and MAPI Developer Tool
> > -"JP" <jp2....DeleteThis@earthlink.net> wrote in message
>
> >news:2deca1b0-d765-44fe-917a-ba69b387dc58@h60g2000hsg.googlegroups.com....
> > There are a couple of threads on the issue, and I can't locate them at
> > the moment, but I believe the consensus was you needed to use
> > Redemption to do this. I can try to locate them if you really want an
> > accurate answer.
>
> > Regarding your followup question, you would need to check the
> > ConversationIndex to see if there is an existing message.
> > Seehttp://www.outlookcode.com/codedetail.aspx?id=1714forcode sample. As
> > an alternative, you could check if Left$(MailItem.Subject, 3) = "RE:"
>
> > HTH,
> > JP
>
> > On Oct 23, 12:50 pm, Josh <jgordon....DeleteThis@gmail.com> wrote:
>
> > > On Oct 23, 11:09 am, "Jan Hyde (VB MVP)"
>
> > > <StellaDrin....DeleteThis@REMOVE.ME.uboot.com> wrote:
> > > > Josh <jgordon....DeleteThis@gmail.com>'s wild thoughts were released on
> > > > Thu, 23 Oct 2008 07:25:02 -0700 (PDT) bearing the following
> > > > fruit:
>
> > > > >Like many other posters I've seen, I sometimes send mail from the
> > > > >wrong account in Outlook 2007. I wanted to create a macro that when I
> > > > >sent a message, would prompt me to verify the sending account, and
> > > > >let
> > > > >me change if necessary.
>
> > > > >I have the following code:
> > > > >Private Sub Application_ItemSend(ByVal item As Object, Cancel As
> > > > >Boolean)
>
> > > > >If TypeOf item Is Outlook.MailItem Then
> > > > > 'Show form that displays account list and sets
> > > > >item.SendUsingAccount
>
> > > > > 'To debug, verify it's using the right account:
> > > > > msgbox item.SendUsingAccount
> > > > >End if
>
> > > > >End Sub
>
> > > > >The routine works in the sense that it displays the list of accounts,
> > > > >and sets the item.SendUsingAccount value properly (the messagebox
> > > > >displays the correct value). However, it goes through and sends the
> > > > >mail from the originally selected account anyways. It seems like once
> > > > >you get to the ItemSend event, it's too late to change the account
> > > > >for
> > > > >the current message if it gets sent. However, if something interrupts
> > > > >the sending process (like another check for having a subject that
> > > > >could set cancel = TRUE and cancel the sending, or stepping through
> > > > >the code in debug mode), it will actually update the sending account
> > > > >(which I can see reflected in the message window, cause it didn't
> > > > >actually send).
>
> > > > >My question is... is there any way to update the SendUsingAccount
> > > > >property once you get to the ItemSend event? If not, is there an
> > > > >earlier place to trap this event? Is there a way to trap the event of
> > > > >clicking the send button and then running this code?
>
> > > > >Thanks in advance.
>
> > > > Why not set 'Cancel' yourself, set the properties you want
> > > > to change and resend.
>
> > > > You'll need some sort of flag to prevent being prompted on
> > > > the resend of course.
>
> > > > --
> > > > Jan Hyde (VB MVP)
>
> > > >https://mvp.support.microsoft.com/profile/Jan.Hyde
>
> > > Well, that's what I had to settle for. I now just display a message
> > > "Are you sure you want to send from account: ACCOUNT_NAME" OK/Cancel.
> > > However, I was wondering if there was a more elegant solution.
>
> > > As a follow-up, is there a way to know if a message is a new message
> > > or a reply/forward? I don't really need to perform this check if I'm
> > > simply replying to a message, it's more important for a new message.
>
> > > Thanks,
> > > Josh- Hide quoted text -
>
> > > - Show quoted text -
>
> The length=44 for ConversationIndex worked like a charm. Thanks!
>
> I'm not familiar with redemption and a quick search didn't reveal
> anything too helpful. Would you mind posting an example?
>
> Thanks,
> Josh

I'm not sure I understand. I know that I don't need Redemption for
figuring out if it's a new message or reply, I got that by using the
conversationIndex. The open question is still how to set the
item.SendUsingAccount property in the ItemSend event or to figure out
a way to set it earlier in the process.
Back to top
Login to vote
Dmitry Streblechenko

External


Since: Nov 23, 2003
Posts: 1123



(Msg. 8) Posted: Thu Oct 23, 2008 3:52 pm
Post subject: Re: Setting Send-From Account in VBA [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You cannot change teh accout in teh ItemSen event.
As was previously suggested, Cancel the event, set the appropriate account,
then call MailItem.Send again.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Josh" <jgordon428.DeleteThis@gmail.com> wrote in message
news:534b10e3-3ad6-4efe-8a0b-be45fd0aa965@l77g2000hse.googlegroups.com...

I'm not sure I understand. I know that I don't need Redemption for
figuring out if it's a new message or reply, I got that by using the
conversationIndex. The open question is still how to set the
item.SendUsingAccount property in the ItemSend event or to figure out
a way to set it earlier in the process.
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> Programming VBA All times are: Eastern Time (US & Canada) (change)
Goto page 1, 2, 3
Page 1 of 3

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
  Office
 Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET