简体   繁体   English

如何使用VBA在SharePoint中打开文件夹的最后一个文件?

[英]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.

相关问题 如何使用 VBA 在 Sharepoint 站点中打开文件 - How to open a file in a Sharepoint site using VBA 如何使用 VBA 在 SharePoint 中获取文件的上次修改日期? - How will I get the last modified date of a file in a SharePoint using VBA? VBA从共享点文件夹中打开特定的Excel文件 - VBA to open a particular excel file from an sharepoint folder 如何使用 VBA 从 Sharepoint 获取 Excel 文件的上次修改日期? - How to Get Last Modified Date of excel file from Sharepoint using VBA? vba Excel-如何检查SharePoint网站文件是否打开 - vba Excel - How to Check if a SharePoint Website File is Open 如何在VBA中使用IF打开文件 - how to open a file using IF in VBA VBA-Office 365 / SharePoint-如何获取Sharepoint上文件的最后修改日期? - VBA - Office 365/SharePoint - How to get last modified date of file on Sharepoint? VBA-检查SharePoint中是否存在文件夹/文件 - VBA - Checking Folder/File exist in SharePoint 如何打开保存在特定位置的 Excel 文件,使用 VBA 从工作表中的最后一个选项卡创建一个新选项卡 - How to open Excel file saved at specific location,Create a new tab as of last tab in a sheet using VBA VBA - 如何在 Excel 2010 的目录中获取最后修改的文件或文件夹 - VBA - How to get the last modified file or folder in a directory in Excel 2010
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM