Document.Path 属性 (Publisher)
返回 String 类型值,表示已保存的当前出版物文件的完整路径,不包括最后的分隔符或文件名。
语法
表达式。路径
表达 一个代表 Document 对象的变量。
备注
FullName 属性可以用于返回的路径和文件名称。
示例
下面的示例演示的 路径 、 名称 和 FullName 属性之间的区别。 如果出版物保存在默认位置以外的文件夹中,则本示例很好地说明。
Sub PathNames()
Dim strPath As String
Dim strName As String
Dim strFullName As String
strPath = Application.ActiveDocument.Path
strName = Application.ActiveDocument.Name
strFullName = Application.ActiveDocument.FullName
' Note the file name & path differences
' while executing.
MsgBox "The path is: " & strPath
MsgBox "The file name is: " & strName
MsgBox "The path & file name are: " & strFullName
End Sub
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈