Re: Adding code to create fldr to the "saving embedded graphics" macro??
From: Ken Slovak - [MVP - Outlook] (kenslovak_at_mvps.org)
Date: 02/09/05
- Next message: Ken Slovak - [MVP - Outlook]: "Re: Reply/Replyall/Forward Events"
- Previous message: Eric Legault [MVP - Outlook]: "RE: Final touches"
- In reply to: StargateFan: "Re: Adding code to create fldr to the "saving embedded graphics" macro??"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 9 Feb 2005 10:44:31 -0500
That original Web site code, wherever it is, it's not written very well...
Open your Outlook VBA project or whatever project your current code lives
in. Select Tools, References. In the list of libraries scroll down until you
see Windows Scripting Runtime. Check that and click OK. Your code should
then run without errors.
I have a somewhat similar procedure on my Web site, but it would have to be
modified to do what you want. The code I presented does what you want. My
Web site example is located at
http://www.slovaktech.com/code_samples.htm#StripAttachments
It almost looks as if my code sample was modified a little by someone who
didn't really understand it to come up with the code sample you have.
-- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "StargateFan" <IDon'tAcceptSpam@IDon'tAcceptSpam.com> wrote in message news:ohvj01ptl51mg75r4oko9im38ns8o9bdnb@4ax.com... > On Tue, 8 Feb 2005 09:24:33 -0500, "Ken Slovak" <kenslovak@mvps.org> > wrote: > >>You most likely don't have a project reference set to the scripting >>runtime >>(Scrrun.dll), which appears in the references list as Windows Scripting >>Runtime. That would cause that error. > > Wish I understood what you just said. <vbg> I'm just a power user, I > have no knowledge of these things, unfortunately. But anyway, bottom > line is that the script provided doesn't work as is? Unfortunately, > that the code that was given and I don't know how to fix it. <sigh> > > Anyone have a working script they can share, by any chance, pls? > > Again, the original code provided on a website that deals with saving > embedded graphics is this (within quotes only, of course): > > "Sub SaveAttachment() > Dim objCurrentItem As Outlook.MailItem > Dim colAttachments As Outlook.Attachments > Dim objAttachment As Outlook.Attachment > > Set objCurrentItem = Application.ActiveInspector.CurrentItem > Set colAttachments = objCurrentItem.Attachments > Set strFolderpath = CreateObject("WScript.Shell") > > For Each objAttachment In colAttachments > objAttachment.SaveAsFile > ("C:\WINDOWS\Desktop\YAHOOgroups\!Attachments saved from Outlook\" & > objAttachment.FileName) > Next > > Set objAttachment = Nothing > Set colAttachments = Nothing > Set objCurrentItem = Nothing > > End Sub" > > I just need to add whatever is needed to the code above to create the > folder if it's not already there. So something that would take care > of checking for folder, creating it if not there or proceeding with > rest of script if it is. > > Thanks! <g>
- Next message: Ken Slovak - [MVP - Outlook]: "Re: Reply/Replyall/Forward Events"
- Previous message: Eric Legault [MVP - Outlook]: "RE: Final touches"
- In reply to: StargateFan: "Re: Adding code to create fldr to the "saving embedded graphics" macro??"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|