| || |
Need help with verifying an attachment comes into Outlook.
User Jon Daily (JDaily@procard.com.nospam) posted:
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
Hey gang. I've got an application that generates offline reports, and sends
them via e-mail.
I was looking for suggestions to verify that an email has been received (in
Outlook 2000) with an attachment with a particular filename.
For example, I am capable of capturing the filename from the application
(i.e. 20107_1.exe, or 20107_1.rtf)
What I need help with is how to verify that an email makes it to my inbox
with that file attached.
The email will contain a constant subject, and will be generated from the
same email address.
Thanks in advance,
Re: Need help with verifying an attachment comes into Outlook.
User Rino (firstname.lastname@example.org) posted:
This script will read all emails in the Inbox, then print the data only for
the 'UnRead' ones. This should get you started, adjust as needed. This
code has been tested with OL97, I'm not sure if it will work with OL2000.
On Error Goto cleanup
Dim objOutLook As Object
Dim objNameSpace As Object
Dim objFolder As Object
Dim objMailItem as Object
Dim intCounter as Integer
' Set the application object
Set objOutLook = CreateObject("Outlook.Application")
' Set the namespace object
Set objNameSpace = objOutLook.GetNamespace("MAPI")
' Set the folder (in this case 'Inbox')
Set objFolder = objNameSpace.Folders("Mailbox -
SQAConsoleWrite "Total number of messages: " & objFolder.Items.Count
' Loop through all the messages in the Inbox
For intCounter = 1 to objFolder.Items.Count
'Create a mailitem object, using the counter
Set objMailItem = objFolder.Items(intCounter)
'If the mailitem has not been read yet...
If objMailItem.Unread = TRUE Then
'... write sender name, date, etc.
SQAConsoleWrite "Message " & intCounter
SQAConsoleWrite "Sender : " & objMailItem.SenderName
SQAConsoleWrite "Date Received: " &
SQAConsoleWrite "Time Received: " &
SQAConsoleWrite "Subject : " & objMailItem.Subject
SQAConsoleWrite "Filename : " &
'Unload objects from memory
Set objFolder = Nothing
Set objNameSpace = Nothing
Set objOutlook = Nothing
"Jon Daily" <JDaily@procard.com> wrote in message