Re: Adding code to create fldr to the "saving embedded graphics" macro??

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Ken Slovak - [MVP - Outlook] (kenslovak_at_mvps.org)
Date: 02/09/05


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>


Relevant Pages

  • Re: Cross Domain Scripting Vulnerability, Javascript
    ... The local computer zone in XP SP2 doesn't have permissions to execute ... >>> Microsoft Internet Explorer file:javascript: Cross Domain Scripting ... The web site has to know the exact path and name of the ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • [Corrected CVE number] Re: Fix available for Sgdynamo
    ... The referenced SecurityTracker report contains the correct number -- it ... > about a cross-site scripting bug in a script called Sgdynamo. ... A remote user can conduct cross-site scripting attacks against ... > from the web site running the Ecometry software and would run in the ...
    (Vuln-Dev)
  • Re: delphi script vcl
    ... > but a nice multi purpose scripting language. ... Registering your DScriptVCL components is very fast and free. ... the latest version available on our Web site. ... Not to send more than one DScript VCL information message per month. ...
    (borland.public.delphi.non-technical)
  • Re: AD Object Attributes
    ... Another great web site (that has recently gone under some serious ... computer account objects. ... I can not help you with the scripting solution as I am still a non-scripter ... You can create the policy and apply it ...
    (microsoft.public.win2000.active_directory)