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

creating toolbar button to Mark As Read & Delete



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 21st 07, 12:41 AM posted to microsoft.public.outlook.program_vba
Andrea
external usenet poster
 
Posts: 44
Default creating toolbar button to Mark As Read & Delete

I'm a VBA beginner. I tried to create a toolbar button that marks mail as
read & deletes it, and already I'm beyond my meager skills. I can create the
button & assign a macro to it, but I can't write the macro code!

So what's the code that will make a button mark mail as read and then delete
it?

Thanks very much,
Andrea
Ads
  #2  
Old June 21st 07, 06:03 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default creating toolbar button to Mark As Read & Delete



For one in a folder selected email:

Dim Mail as Outlook.MailItem
Set Mail=Application.ActiveExplorer.Selection(1)
Mail.Unread=False
Mail.Save
Mail.Delete

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize Outlook email:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Wed, 20 Jun 2007 16:41:33 -0700 schrieb Andrea:

I'm a VBA beginner. I tried to create a toolbar button that marks mail as
read & deletes it, and already I'm beyond my meager skills. I can create

the
button & assign a macro to it, but I can't write the macro code!

So what's the code that will make a button mark mail as read and then

delete
it?

Thanks very much,
Andrea

  #3  
Old June 21st 07, 07:26 PM posted to microsoft.public.outlook.program_vba
Andrea
external usenet poster
 
Posts: 44
Default creating toolbar button to Mark As Read & Delete

That worked great! But it sure didn't look anything like I thought it would
-- guess I'd better hit the books & learn some more

Thank you Michael.
--
Andrea



 




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
Mark As Read JonWayn Outlook and VBA 1 January 25th 07 05:37 AM
Rules to Mark as Read only at Weekends Sean Outlook - General Queries 1 November 1st 06 01:05 PM
How do I modify Delete button to also mark item as read? [email protected] Outlook and VBA 1 April 24th 06 06:14 AM
Mark as read Sven Berg Outlook - General Queries 1 February 8th 06 09:20 AM
Mark as Read? After x seconds? HotRod Outlook - General Queries 2 January 12th 06 07:22 PM


All times are GMT +1. The time now is 04:13 AM.


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