PC Review


Reply
 
 
Rizza
Guest
Posts: n/a
 
      4th Nov 2004
I am a newbie to Outlook VBA so please have patience.
What I need to create is code that I can attach to a button to delete emails
from another users folder and then to permanently delete them from the
deleted items.
Anything would be helpful.
Thanks in advance


 
Reply With Quote
 
 
 
 
=?Utf-8?B?RXJpYyBMZWdhdWx0IFtNVlAgLSBPdXRsb29rXQ==
Guest
Posts: n/a
 
      4th Nov 2004
Use the GetDefaultSharedFolder method to return another user's mailbox, and
loop through the MAPIFolder object's Items collection to retrieve individual
MailItem objects and use the Delete method.

The FolderType parameter for GetDefaultSharedFolder will allow you to return
the Inbox or Deleted Items folder, amongst others.

You'd have to provide additional coding logic to find the message you just
deleted in the Deleted Items folder by either looping through Items and
comparing Subject property values, or use the Restrict method, and then
delete that message as well.

Or you could use CDO; the Message.Delete method allows you to bypass sending
the message to Deleted Items.

For more resources for programming with Outlook, start here:

Visual Basic and VBA Coding in Microsoft Outlook:
http://www.outlookcode.com/d/vb.htm

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/

"Rizza" wrote:

> I am a newbie to Outlook VBA so please have patience.
> What I need to create is code that I can attach to a button to delete emails
> from another users folder and then to permanently delete them from the
> deleted items.
> Anything would be helpful.
> Thanks in advance
>
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete data in a linked Excel sheet using Access code or seql delete Rocky Microsoft Access External Data 9 26th Jun 2005 01:42 AM
Re: Macro to delete sheets and saves remaining file does not properly delete module gazornenplat Microsoft Excel Programming 0 22nd Jun 2005 02:12 AM
Macro to delete sheets and saves remaining file does not properly delete module pherrero Microsoft Excel Programming 7 21st Jun 2005 06:16 PM
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below Annette Microsoft Excel Programming 2 21st Sep 2004 03:40 PM
Re: When I highlight a sentence to delete, Word won't let me. I have to backspace. How can I deleted selected text with my delete key? Bill Foley Microsoft Word Document Management 1 5th Feb 2004 12:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:00 AM.