Application.Path プロパティ (Publisher)

保存した作業中の文書のファイルへの完全なパスを示す文字列型 (String) の値を取得します。このパスには、最後の区切り文字またはファイル名は含まれません。

構文

パス

expressionApplication オブジェクトを 表す変数。

注釈

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 のサポートおよびフィードバックを参照してください。