Hello,
I am new to this forum and to scripting, and was hoping I could find
some help.
I want to email off a log file that is created each week. It puts the
report into the following path (and the html log file name is always
random):
c:\Nov2005\Week1\log0011029273.html
The month and week folders are created new each week, so I cant use a
static file location.
I have the following script that works fine for static files:
--------------------------------------------
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Example CDO Message"
objMessage.Sender = "sc@co.com"
objMessage.To = "sc@co.com"
objMessage.TextBody = "This is some sample message text."
objMessage.AddAttachment "c:\Nov2005\Week1\log0011029273.html"
'==This section provides the configuration information for the remote
SMTP server.
'==Normally you will only change the server name or IP.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"mail.co.com"
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
'==End remote SMTP server configuration section==
objMessage.Send
-----------------------------------------------------------
..but every time this report is run, it creates a new path to the new
report file...so this has to be the current
C:\month\week\randomlogfilename.html
Any help in constructing this would be much appreciated.
--
sc48226
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------