How can I get a changing filename to email that file daily.
this is the line in the VBscrtipt.
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.Getfile("C:\WINNT\fontstore\Logs\*.zzr")
I know this object does not allow for wildcards. Anyway around that?
I was able to capture the filename with the MacroScheduler script but can't pass that to the VBscript.
GetFileList>C:\WINNT\fontstore\Logs\Travis*.ZZR,logfile1
Filename with wildcard
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Why can't you pass the filename to the VBScript?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Ok, how do I send the Logfile1 MAcro Scheduler variable to the VB script to be assigned to sattachment. When I try
sAttachment = logfile1
I get the error "you must provide a file path"
I edited the code for the important segments.
>>
GetFileList>C:\WINNT\fontstore\Logs\Travis*.ZZR,logfile1
VBSTART
sAttachment = "C:\logfile.zzr"
Set AttachME = doc.CreateRichTextItem("Attachment")
Call doc.SEND(False, arrRecipients)
VBEND
VBRUN>SendNotesEmail
sAttachment = logfile1
I get the error "you must provide a file path"
I edited the code for the important segments.
>>
GetFileList>C:\WINNT\fontstore\Logs\Travis*.ZZR,logfile1
VBSTART
sAttachment = "C:\logfile.zzr"
Set AttachME = doc.CreateRichTextItem("Attachment")
Call doc.SEND(False, arrRecipients)
VBEND
VBRUN>SendNotesEmail
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
What you do is add parameters to the subroutine/function and pass them in VBRun/VBEval. So here's a skeleton:
Code: Select all
VBSTART
Sub SendNotesEmail(LogFile)
'bla bla
sAttachment = LogFile
'bla bla
End Sub
VBEND
Let>logfile1=c:\whatever....
VBRun>SendNotesEmail,logfile1
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?