Automate send mail when file has been updated

  • Thread starter Thread starter Wojo
  • Start date Start date
W

Wojo

I would like to send out an email each time a file (text or excel) has
been updated. I guess a trigger would have to key off of the Date
Modified time but I'm not sure if this is the best route. For now I
would
just like a high level overview of the best way to perform this task.
Is VBA the only way or are there
better ways to automate this task?
 
Wojo said:
I would like to send out an email each time a file (text or excel) has
been updated. I guess a trigger would have to key off of the Date
Modified time but I'm not sure if this is the best route. For now I
would
just like a high level overview of the best way to perform this task.
Is VBA the only way or are there
better ways to automate this task?

I assume you really mean "Send an EMail each time a file in
a specific folder has been updated". You could use the Task
Scheduler to run this batch file once every 5 minutes:

Line1 @echo off
Line2 cdd /d "D:\Some Folder"
Line3 if exist "%Temp%\Last.txt" (
Line4 dir *.txt > "%Temp%\Current.txt%"
Line5 fc "%Temp%\Current.txt%" "%Temp%\Last.txt" | find /i "No
differences" && goto Label1
Line6 blat /.. /..
Line7 )
Line8 :Label1
Line9 copy /y "%Temp%\Current.txt" "%Temp%\Last.txt"

blat.exe is a command line mailer that can be downloaded from
a number of sites.
 
Replied to [Wojo]s message :
I would like to send out an email each time a file (text or excel) has
been updated. I guess a trigger would have to key off of the Date
Modified time but I'm not sure if this is the best route. For now I
would
just like a high level overview of the best way to perform this task.
Is VBA the only way or are there
better ways to automate this task?


You can use VBs. Post in VBs newsgroup(someone will give you the full code).
 
Back
Top