Saving GroupWise Report attachments to a directory

FrankD

New member
Joined
Mar 7, 2013
Messages
1
Reaction score
0
Points
0
The code from the original article Extract Novell Groupwise Attachments And Save To A Directory works great.

I was hoping someone could post a modification that would allow the script to save non-uniquely named attachments with a unique name.
Specifically, GroupWise sends a daily accounting report to the postmaster as an attachment "acct" with no extension. (There are other reports like GWCHECK that similarly are sent as non-uniquely named attachments without extensions).

I have several months worth of daily report emails, each with a single "acct" attachment, in a mailbox folder. As it stands, If I specify no extension using sFileType = "" the script does run through each email and saves the acct file to the specified local directory, but since all the attachments are the same name, the script simply overwrites as it saves the files to the specified directory.


Can anyone add a couple lines that would allow the script to save attachments with duplicate names as files with unique names and append a file extension. It can be as simple as appending a three digit identifier and a .txt extentsion - acct001.txt acct002.txt acct003.txt



Thanks,

Frank
 
Frank, I don't want to jump in on Ken's code here, but it looks like you could make a simple modification to this part...
Code:
                If Right(.Attachments(i).Filename, len(sFileType)) = sFileType Then
                    .Attachments(i).Save _
                        sSavePath & "\" & .Attachments(i).Filename
                End If

If you just want to add an increment count and a .txt extention, then you already have that in the loop variable 'i". You could try changing the sSavePath line to something like this...
Code:
sSavePath & "\" & .Attachments(i).Filename & "_" & i & ".txt"
 
Back
Top