Jump to content
Macro Express Forums

Getting the path of the triggered file in directory modification


Recommended Posts

I have a main folder that has a number of subfolders. When a file is added to any of the subfolders a macro should run......but this macro modifies the added file(triggered file)....How can I get the path of the triggered file.

 

I also want the macro to run only when a file is added. The macro should not run when the file is deleted. Please suggest.

 

 

Thanks

Link to comment
Share on other sites

You will probably need to maintain a list of files in a file or registry someplace and do some comparisons. Whenever the macro finishes it should output a list of files. Then when the macro gets triggered repeat with folder thru all the files and when you find one that is not on the list then that's your file.

 

I just had another idea. When the macro complete the previous time save a time var for the current time. The next time it runs it can do a Repeat With Folder and any files newer than the date are, well..., new.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...