简体   繁体   English

Powerpoint宏获取文件的最后修改日期

[英]Powerpoint macro to get the last modified date of a file

I want to get the last modified date of a ppt file and put the condition : if it's in after thursady of the week than out else go on. 我想获取一个ppt文件的最后修改日期并放入条件:如果它是在一周的节假日之后进入的,则继续进行下去。 That's what i wrote but it doesn't work! 那是我写的,但是没有用!

Sub proprietes()


Set fs = CreateObject("Scripting.FileSystemObject")
FilePath = "C:\Users\Moez\Desktop\Macro Project\test v2"
Set f = fs.GetFile(FilePath)
fileModDate = f.DateLastModified
End Sub

i always get the mistake in Set f = fs.GetFile(FilePath) !! 我总是在Set f = fs.GetFile(FilePath)出错!

Could you help me please? 请问你能帮帮我吗? thanks a lot 非常感谢

Try this 尝试这个

Sub proprietes()

Set fs = CreateObject("Scripting.FileSystemObject")
FilePath = "C:\Users\....\Desktop\TestPPT.pptx"
Set f = fs.GetFile(FilePath)
fileModDate = f.DateLastModified
End Sub

maybe something like this 也许像这样

 FilePath = Dir("C:\Users\Moez\Desktop\Macro Project\test v2*")
 fileModDate = FileDateTime(FilePath)

https://www.techonthenet.com/excel/formulas/filedatetime.php https://www.techonthenet.com/excel/formulas/filedatetime.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM