bassnsjp
02-21-2013, 06:50 PM
Dang it this the second time typing this in apparently the server was busy.
OS: Windows XP Outlook: 2003
I have a macro that upon selecting an Outlook folder will process each email in the folder and subfolder and save them out to a selected directory. The macro works very well, except for the condition I ran into today.
Scenario:
A particular email has 15 attachments it just so happens they are all embedded emails. Not a problem the marco deals with them normally with no problems. Also, MsgItem.Attachments.Count returns the correct count of 15. However, of the 15 embedded emails 7 of them have the EXACT same title as several of the other embedded emails. To deal with this Outlook appends (1), (2), (3), etc to the copies to make the titles UNIQUE.
Issue:
When I cycle through the number of attachments Outlook ONLY provides me with the 8 unique attachments and does not process the rest. Therefore, the output directory only contains 8 of the 15 files. This might not be an issue however, the 7 embedded emails that appear to be EXACT copies because of the title actually contain different content. I found this out by comparing the files that were saved out with the actual attachments in the email. All emails with (1), (2) append did indeed have different data, but were not saved out.
The code is on my PC at work that is not connected to the internet. However, a small snipet of the code that cycles through the attachments is included below.
Any assistance would be greatly appreciated.
If (TypeName(MsgItem) <> "AppointmentItem") Then
Call ProcessEmail
If (TypeName(MsgItem) <> "NoteItem") Then
Set MsgAtt = MsgItem.Attachments
For iatt = Attmcnt To 1 Step -1
Call ProcessAttachment
Next
End If
Else
CalErrMsg.Show
ExitProc = True
FSOLogFile.Writeline String(50, "*") & " Appointment Mail Item encountered. Please delete calendars and rerun script " & String(50, "*")
Call ExitProcedure
Exit Sub
End If
OS: Windows XP Outlook: 2003
I have a macro that upon selecting an Outlook folder will process each email in the folder and subfolder and save them out to a selected directory. The macro works very well, except for the condition I ran into today.
Scenario:
A particular email has 15 attachments it just so happens they are all embedded emails. Not a problem the marco deals with them normally with no problems. Also, MsgItem.Attachments.Count returns the correct count of 15. However, of the 15 embedded emails 7 of them have the EXACT same title as several of the other embedded emails. To deal with this Outlook appends (1), (2), (3), etc to the copies to make the titles UNIQUE.
Issue:
When I cycle through the number of attachments Outlook ONLY provides me with the 8 unique attachments and does not process the rest. Therefore, the output directory only contains 8 of the 15 files. This might not be an issue however, the 7 embedded emails that appear to be EXACT copies because of the title actually contain different content. I found this out by comparing the files that were saved out with the actual attachments in the email. All emails with (1), (2) append did indeed have different data, but were not saved out.
The code is on my PC at work that is not connected to the internet. However, a small snipet of the code that cycles through the attachments is included below.
Any assistance would be greatly appreciated.
If (TypeName(MsgItem) <> "AppointmentItem") Then
Call ProcessEmail
If (TypeName(MsgItem) <> "NoteItem") Then
Set MsgAtt = MsgItem.Attachments
For iatt = Attmcnt To 1 Step -1
Call ProcessAttachment
Next
End If
Else
CalErrMsg.Show
ExitProc = True
FSOLogFile.Writeline String(50, "*") & " Appointment Mail Item encountered. Please delete calendars and rerun script " & String(50, "*")
Call ExitProcedure
Exit Sub
End If