I also couldn't get the code to display here for some reason so I sent it to a text file and zipped it (said I had a forbidden word!). Thanks so much for the help so far!!11374 Plus, my database will update daily when opened and when requested by the user (just in case the email is late) and I am using DAO so it would only be connected when updating. Select the files you will attach, right click and select Send to > Compressed (zipped) folder from the right-clicking menu. Go to the folder containing the files you will attach in email. Also, the company who will be sending this email may be sending it to more then one person and they may have this running so I wonder if I need a check to make sure something else is not using the file. However, we can zip files you will attach in emails firstly, and then attach the zipped files in emails. It did copy the Zip file to the specified folder and killed/updated the file but I never saw any excel files extracted.Īlso, when it unzips the file is there a way to specify a name for the file no matter what the name is in the zip file? There must be a rename object for the shell object right? (I'm really just guessing!). I did change the path and I walked through it to see how it worked on the file (which was a zip) with one file inside that was an. If multiple emails arrive at the same time i am not sure if every email fires the newmail event individually or as a batch, if not it would be easy to work around that xls in the zip file will be extracted (others will be ignored), this can obviously be changed if required, if the xl file is open (or referrenced) in excel an error may occur at trying to kill or rename Kill dest & xlfile ' required as name will not overwriteĮnd Subthis is as a whole untested and may contain typos or code errors, change all filenames, extentions and folders to suit, if for any reason the filename of the zipped xls file still exists within the dest folder an overwrite dialog will be raised by the shell object, as coded only the first. If LCase(Right(fil.Name, 4) = ".xls") Then Set sh = CreateObject("shell.application") If LCase(Right(a.FileName, 4)) = ".zip" Then If Not i.SenderName = "mymate" Then Exit Sub ' ignore from everyone else pdf) to the procedure, the result is that when I open the file from email address, it's corrupted or is impossible to open (from word or Acrobat) The procedure is this, and the I call it from a file asp, where the filename2 is the attachment file and the filetype2 is application/pdf or application. Set f = GetNamespace("Mapi").Folders("Personal Folders").Folders("Inbox").Items When I try to give a file attachment (.doc or. You can use the application_newmail event for it to run automaticallyĭim i As MailItem, f As Items, a As Attachment You can use a windows shell object to unzip
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |