|
-
September 20th, 2001, 06:45 AM
#1
Newbie needs advice on VB/Outlook
Complete newbie to VB.
I need to use VB6 to open Outlook 97 Inbox, search for an unread mail from a specific person, save two attachments therein and then perhaps delete the mail.
Haven't a cluie where to start:-) and any help woiuld be much appreciated.
Thanks
<b>Chris Bryce</b> <a href="http://www.wavefold.co.uk">www.wavefild.co.uk</a>
-
September 20th, 2001, 06:51 AM
#2
Re: Newbie needs advice on VB/Outlook
Ah markup<>HTML
Chris Bryce
http://www.wavefold.co.uk
-
September 20th, 2001, 08:48 AM
#3
Re: Newbie needs advice on VB/Outlook
Here's the code. What it does is run through all the messages in your inbox, if the sender is a specific person, check for attachments and save them to your hd
private Sub Command1_Click()
Dim OLApp as new Outlook.Application
Dim OLNS as Outlook.NameSpace
Dim OLFL as Outlook.MAPIFolder
Dim OLMI as Outlook.MailItem
Dim OLAT as Outlook.Attachment
set OLNS = OLApp.GetNamespace("MAPI")
set OLFL = OLNS.GetDefaultFolder(olFolderInbox)
for Each OLMI In OLFL.Items
If OLMI.SenderName = "Cakkie" then
for Each OLAT In OLMI.Attachments
OLAT.SaveAsFile "c:\" & OLAT.FileName
next OLAT
End If
next OLMI
End Sub
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
-
September 21st, 2001, 06:07 AM
#4
Re: Newbie needs advice on VB/Outlook
Thank you tbis was perfect for what I needed.
Chris Bryce
http://www.wavefold.co.uk
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|