ShortPath 属性

返回由需要以前的 8.3 文件命名约定的程序使用的短路径。

语法

对象ShortPath

对象始终是 FileFolder 对象。

备注

以下代码演示如何将 ShortPath 属性与 File 对象配合使用。

Sub ShowShortPath(filespec)
    Dim fs, f, s
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFile(filespec)
    s = "The short path for " & "" & UCase(f.Name)
    s = s & "" & vbCrLf
    s = s & "is: " & "" & f.ShortPath & ""
    MsgBox s, 0, "Short Path Info"
End Sub

另请参阅

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。