Aracılığıyla paylaş


_DTE.ActiveDocument Özellik

Etkin belgeyi alır.

Ad alanı:  EnvDTE
Derleme:  EnvDTE (EnvDTE.dll içinde)

Sözdizimi

'Bildirim
ReadOnly Property ActiveDocument As Document
    Get
Document ActiveDocument { get; }
property Document^ ActiveDocument {
    Document^ get ();
}
abstract ActiveDocument : Document
function get ActiveDocument () : Document

Özellik Değeri

Tür: EnvDTE.Document
Document nesnesi

Açıklamalar

Etkin bir belge odaklı biridir. Başka bir belge etkin hale getirmek için kendi penceresinde odağı ayarlayın.

Resim yazısı sadece aracı windows üzerinde ayarlayabilirsiniz. Belge pencerelerini gibi diğer pencere türleri üzerinde resim yazısı ayarlamaya çalışırsanız aldığınız hata, "Belirtilmeyen hata."

Örnekler

Sub ActiveDocumentExample()
  Dim objTextDoc As TextDocument
  Dim objEP As EditPoint
  
  'Create a new text document.
  Call DTE.ItemOperations.NewFile("General\Text File")
  'Get a handle to the new document.
  Set objTextDoc = DTE.ActiveDocument.Object("TextDocument")
  Set objEP = objTextDoc.StartPoint.CreateEditPoint
  'Create an EditPoint and add some text.
  objEP.Insert "A test sentence."
End Sub

Sub DocumentExample()
  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

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

_DTE Arabirim

EnvDTE Ad Alanı