The reason is the Application object only applies when you're writing scripts for Office applications. Same thing with the Inspector objects and such. When you have a folder script, you have to use CDO. You're trying to use the Outlook Object Model in your folder script which won't work. I suggest you go through www.cdolive.com thoroughly and learn more about event scripting.
S. -----Original Message----- From: Masthanaiah Cheekavolu [mailto:[EMAIL PROTECTED]] Sent: Monday, December 03, 2001 12:27 AM To: Exchange Discussions Subject: Saving Attachments using VBScript/Folder Agents Hi, VBScript online help says the following: If you use VBScript, you do not create the Application object. This example shows how to perform the same task using VBScript. Set myItem = Application.ActiveInspector.CurrentItem Set myAttachments = myItem.Attachments myAttachments.Item(1).SaveAsFile "C:\My Documents\" & _ myAttachments.Item(1).DisplayName I am using the above given code ( ex from VBScript online help) in a folder agent script in Outlook to save a log file (comes as an attachment of an email ). I am getting the following error: 12/02/01 20:49:56 Run time error at line 20. Source: Microsoft VBScript runtime error Error: 800a01f4. Description: Variable is undefined: 'Application'. Any idea what is the mistake that I am doing here? The equivalent VBA code given in the online help perfectly works fine. thanks, -Masthan. This message is confidential and may also be legally privileged. If you are not the intended recipient, please notify us immediately. You should not copy it or use it for any purpose, nor disclose it's contents to any other person. The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of Wilco International. _________________________________________________________________ List posting FAQ: http://www.swinc.com/resource/exch_faq.htm Archives: http://www.swynk.com/sitesearch/search.asp To unsubscribe: mailto:[EMAIL PROTECTED] Exchange List admin: [EMAIL PROTECTED] _________________________________________________________________ List posting FAQ: http://www.swinc.com/resource/exch_faq.htm Archives: http://www.swynk.com/sitesearch/search.asp To unsubscribe: mailto:[EMAIL PROTECTED] Exchange List admin: [EMAIL PROTECTED]

