Condividi tramite


Proprietà Document.Path

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

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

Sintassi

'Dichiarazione
ReadOnly Property Path As String
string Path { get; }
property String^ Path {
    String^ get ();
}
abstract Path : string with get
function get Path () : String

Valore proprietà

Tipo: 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 radice 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

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Document Interfaccia

Spazio dei nomi EnvDTE