Window.Caption-Eigenschaft (Project)
Ruft ab oder legt den Text in der Titelleiste des Projektfensters. Zeichenfolge mit Lese-/Schreibzugriff.
Syntax
Ausdruck. Überschrift
Ausdruck Eine Variable, die ein Window-Objekt darstellt.
Hinweise
When the active window is maximized, the title bar displays the caption for both the main and active windows, separating the captions with a hyphen. For example, if the caption for the main window is "Microsoft Project" and the caption for the active window is "Project1.mpp", the title bar displays "Project1.mpp - Microsoft Project" when the active window is maximized.
Wenn Sie die Caption -Eigenschaft auf Empty festgelegt, wird die Titelleiste der Standardtitel angezeigt. Der Standardtitel für das Hauptfenster ist "Microsoft Project".
In a project with one window, the default caption for the window is the file name of the project. In einem Projekt, in dem mehrere Fenster geöffnet sind, lautet die Standard-Untertitel für jedes Fenster name: n, wobei name der Dateiname des Projekts und n eine eindeutige Nummer für das Fenster ist. For example, if the second window of the project "Project1" is active, the default title bar displays "Project1.mpp:2 - Microsoft Project"
Beispiel
Im folgenden Beispiel wird der Benutzer aufgefordert, die Beschriftung des aktiven Fensters zu ändern.
Sub ChangeWindowCaption()
Dim Entry As String ' Caption entered by user
' Prompt user for a new caption.
Entry = InputBox$("Enter a new caption for the active window (enter 'reset' to set the caption to its default).")
' If user chooses the Cancel button, exit Sub procedure.
If Entry = Empty Then Exit Sub
' Set or reset the caption.
If Entry = "reset" Then
ActiveWindow.Caption = Empty
Else
ActiveWindow.Caption = Entry
End If
End Sub
Support und Feedback
Haben Sie Fragen oder Feedback zu Office VBA oder zu dieser Dokumentation? Unter Office VBA-Support und Feedback finden Sie Hilfestellung zu den Möglichkeiten, wie Sie Support erhalten und Feedback abgeben können.