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 » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

.sent=False



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 7th 06, 10:54 PM posted to microsoft.public.outlook.program_vba
steve
external usenet poster
 
Posts: 317
Default .sent=False

After successfuly putting together the code to open an outlook email and
letting the user decide to send the email or not, I would like the code to do
one thing if the user sends the email and another if they decide to canel.

When the user clicks cancel, I have code that says:

If .Sent = False Then
MsgBox "This message will not be sent.", 64, "Test System"
End If

But, if the user sends the email, the code stops. It does not process any
further. And guess what, If .sent=True does not do anything.

Help please.

Ads
  #2  
Old July 7th 06, 11:44 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default .sent=False

MailItem.Sent is a read-only property. You can't set it in code. Outlook sets it to True after the user (or a code statement) has sent the item.

What procedure is running your code?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Steve" wrote in message ...
After successfuly putting together the code to open an outlook email and
letting the user decide to send the email or not, I would like the code to do
one thing if the user sends the email and another if they decide to canel.

When the user clicks cancel, I have code that says:

If .Sent = False Then
MsgBox "This message will not be sent.", 64, "Test System"
End If

But, if the user sends the email, the code stops. It does not process any
further. And guess what, If .sent=True does not do anything.

Help please.

  #3  
Old July 8th 06, 06:03 PM posted to microsoft.public.outlook.program_vba
steve
external usenet poster
 
Posts: 317
Default .sent=False

Thanks Sue. I am running an Access.mdb that will loop through several
records and create an email for each record. I would like the email to be
displayed and the user decide if they would like to send the email. If they
do, the procedure will do one thing, if they don't, another.


"Sue Mosher [MVP-Outlook]" wrote:

MailItem.Sent is a read-only property. You can't set it in code. Outlook sets it to True after the user (or a code statement) has sent the item.

What procedure is running your code?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Steve" wrote in message ...
After successfuly putting together the code to open an outlook email and
letting the user decide to send the email or not, I would like the code to do
one thing if the user sends the email and another if they decide to canel.

When the user clicks cancel, I have code that says:

If .Sent = False Then
MsgBox "This message will not be sent.", 64, "Test System"
End If

But, if the user sends the email, the code stops. It does not process any
further. And guess what, If .sent=True does not do anything.

Help please.


  #4  
Old July 8th 06, 08:11 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default .sent=False

The message object variable will go out of scope of the procedure that creates it when the user sends or closes the item. If you want to handle either of those events, you'll need to instantiate a MailItem object WithEvents and use write event handlers for its Send and Close events.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Steve" wrote in message ...
Thanks Sue. I am running an Access.mdb that will loop through several
records and create an email for each record. I would like the email to be
displayed and the user decide if they would like to send the email. If they
do, the procedure will do one thing, if they don't, another.


"Sue Mosher [MVP-Outlook]" wrote:

MailItem.Sent is a read-only property. You can't set it in code. Outlook sets it to True after the user (or a code statement) has sent the item.

What procedure is running your code?

"Steve" wrote in message ...
After successfuly putting together the code to open an outlook email and
letting the user decide to send the email or not, I would like the code to do
one thing if the user sends the email and another if they decide to canel.

When the user clicks cancel, I have code that says:

If .Sent = False Then
MsgBox "This message will not be sent.", 64, "Test System"
End If

But, if the user sends the email, the code stops. It does not process any
further. And guess what, If .sent=True does not do anything.

Help please.


 




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
false reminders for all contacts Flip Outlook - Installation 0 June 30th 06 11:24 AM
Unread message indicator false Cooler Dude Outlook Express 1 March 25th 06 07:39 PM


All times are GMT +1. The time now is 08:51 PM.


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.