i have a VBScript, that is in *.asp file. There is script shta should save outlook attachment automatically in to folder.
But how do i run this script? where i have to copy this file? or what should i have to do?
Normally an ASP script file is intended to be executed by a web server like IIS or PWS. Can you post the content of this file to see how to convert them in VBS ?
' FILE DESCRIPTION: Saves all attachments of a new arrived message to a
' particular directory
'
Option Explicit
'------------------------------------------------------------------------------
' Global Variables
'------------------------------------------------------------------------------
' DESCRIPTION: This event is fired when a new message is added to the folder
Public Sub Folder_OnMessageCreated
Dim objSession ' Session
Dim objCurrentMsg ' Current message
Dim objFolder ' Current folder
Dim objAttachment ' Attachment object
Dim objAttachments ' Attachment collection
' Initialize objects
Set objSession = Nothing
Set objCurrentMsg = Nothing
Set objFolder = Nothing
Set objAttachment = Nothing
Set objAttachments = Nothing
' Clear error buffer
Err.Clear
' Get session informationen
Set objSession = EventDetails.Session
' Extract all attachments
For Each objAttachment In objAttachments
' Check if attachment is a file or link
' Note that CDO 1.2x does not support to save OLE objects
' and embedded messages to the file system
If (objAttachment.Type = 1) Or (objAttachment.Type = 2) Then
' Save attachment to the filesystem, write logging
Call DebugAppend("Save attachments to filesystem", False)
' Write attachment to the filesystem
objAttachment.WriteToFile(g_Const_Directory & objAttachment.Name)
End If
Next
' Delete attachments
On Error Resume Next
objAttachments.Delete
End If
' Update message
On Error Resume Next
objCurrentMsg.Update
' Error detected ?
If Err.Number <> 0 then
' Could not sent message, write logging
Call DebugAppend("Error - Could not update message", True)
Else
' Message successfully sent
Call DebugAppend("Success - Message updated successfully", False)
End If
End If
Else
' Could not get current folder
Call DebugAppend("Error - Could not get current folder", True)
End If
Else
' Check for any possible sys errors
Call DebugAppend("Undefinied Error detected", True)
End If
' Write some logging, without the folder name
Call DebugAppend("SaveAtt - Processing finished", False)
' Clear objects
Set objSession = Nothing
Set objCurrentMsg = Nothing
Set objFolder = Nothing
Set objAttachment = Nothing
Set objAttachments = Nothing
' Write results to the Scripting Agent log
Script.Response = g_bstrDebug
End Sub
' DESCRIPTION: This event is fired when the timer on the folder expires
Public Sub Folder_OnTimer
'Not used
End Sub
' DESCRIPTION: This event is fired when a message in the folder is changed
Public Sub Message_OnChange
'Not used
End Sub
' DESCRIPTION: This event is fired when a message is deleted from the folder
Public Sub Folder_OnMessageDeleted
'Not used
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.