[英]How to open the last file of a folder in a SharePoint using VBA?
I would like to ask help on creating commands which will be able to open ONLY the latest file of a folder in a SharePoint using VBA. 我想寻求有关创建命令的帮助,这些命令将只能使用VBA在SharePoint中打开文件夹的最新文件。 Your prompt response is greatly appreciated. 感谢您的及时答复。 Many thanks! 非常感谢!
If you use the shell command Dir (not the VBA command dir) you can sort the files according to date ( /od ) . 如果使用shell命令Dir(而不是VBA命令目录),则可以根据日期(/ od)对文件进行排序。 If you use a descending sort the first file will be the most recent. 如果使用降序排序,则第一个文件将是最新文件。
Sub M_snb()
msgbox split(createobject("wscript.shell").exec("cmd /c Dir G:\OF\*.* /b /o-d").stdout.readall,vbcrlf)(0)
End Sub
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.