msoutlook.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Changing Mailitem property

 
Post new topic   Reply to topic    msoutlook.org Forum Index -> MS Office Outlook
Author Message
MSPJ



Joined: 30 Jan 2008
Posts: 1

PostPosted: Wed Jan 30, 2008 2:55 pm    Post subject: Changing Mailitem property Reply with quote

Hi - I'd like to create a really simple macro that sets the mailitem
property deleteaftersubmit to true, ie so that a message will not be
saved when it is sent. I normally have Save turned on by default, but
I'd like to have a toolbar button to quickly turn this off in an
individual message before I hit send. It would be the same as opening
the options dialog and removing the check box from the Save in folder
parameter.

I'm not familiar enough with VBA to write this subroutine, but I
figure it must be all of 3 lines. Could someone help?

Thanks,
Michael

Archived from group: microsoft>public>office>developer>outlook>vba
Back to top
View user's profile Send private message
Sue Mosher [MVP-Outlook]



Joined: 12 Aug 2007
Posts: 656

PostPosted: Wed Jan 30, 2008 6:30 pm    Post subject: Re: Changing Mailitem property Reply with quote

I'd make it 4 lines:

Sub DoIt()
On Error Resume Next
Application.ActiveInspector.CurrentItem.DeleteAfterSubmit = True
End Sub

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"MSPJ" wrote in message @e23g2000prf.googlegroups.com...
> Hi - I'd like to create a really simple macro that sets the mailitem
> property deleteaftersubmit to true, ie so that a message will not be
> saved when it is sent. I normally have Save turned on by default, but
> I'd like to have a toolbar button to quickly turn this off in an
> individual message before I hit send. It would be the same as opening
> the options dialog and removing the check box from the Save in folder
> parameter.
>
> I'm not familiar enough with VBA to write this subroutine, but I
> figure it must be all of 3 lines. Could someone help?
>
> Thanks,
> Michael

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
How to get mailitem in "Appplication_NewMail" ? Hi, I'm trying to write macro to get a reference to the new mail tanks to function. But to get the new mail, i understood that i have to use ..... Set objItem = If objItem.Class = olMail Then

MailItem.SenderName Hello. I've written an email filter COM Add-in using Outlook 2002 VBA. When accessing the SenderName property of the MailItem object, I get a dialog box from Outlook stating that a program is attempting to access the address book, and do I want to let it

"From" field in the mailitem Res. All Can I get/set the "From" field of a new mailitem? Thanks in advance Prashant

"From" field in the mailitem Res. All Can I get/set the "From" field of a new mailitem? Thanks in advance Prashant

Format of Contact's UserCertificate property Hello, We have been trying to determine the format of the data contained in the property of our contact items in Outlook. We can tell that there are several blobs in the form of (Identifier, blob size, data). We know that the tag ID of 3
Post new topic   Reply to topic    msoutlook.org Forum Index -> MS Office Outlook All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot 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


Powered by phpBB © 2001, 2005 phpBB Group