Proprietà Document.Path

Aggiornamento: novembre 2007

Ottiene il percorso, senza nome file, della directory contenente il documento.

Spazio dei nomi:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Sintassi

ReadOnly Property Path As String

Dim instance As Document
Dim value As String

value = instance.Path
string Path { get; }
property String^ Path {
    String^ get ();
}
function get Path () : String

Valore proprietà

Tipo: System.String

Stringa che rappresenta il percorso, senza nome file, della directory contenente il documento.

Note

Il percorso restituito non include il nome file o l'estensione. Se, ad esempio, il percorso del documento è C:\MsDev\Projects\MyProject\stdafx.cpp, la proprietà Path restituisce la stringa C:\MsDev\Projects\MyProject. Non è presente la barra rovesciata finale, a meno che il percorso non corrisponda alla directory principale di un'unità, ad esempio C:\.

Esempi

Sub PathExample()
    Dim doc As Document
    Dim desc As String

    Set doc = DTE.ActiveDocument
    desc = "You are editing a "
    If (doc.ReadOnly) Then
        desc = desc & "read-only"
    Else
        desc = desc & "writable"
    End If
    desc = desc & " document called " & doc.Name & " located at " & doc.Path
    MsgBox desc
End Sub

Autorizzazioni

Vedere anche

Riferimenti

Document Interfaccia

Membri Document

Spazio dei nomi EnvDTE