DocumentBase.RunLetterWizard(Object, Object) Metoda

Definicja

Uruchamia Kreatora listów w dokumencie.

public void RunLetterWizard (ref object letterContent, ref object wizardMode);
member this.RunLetterWizard : obj * obj -> unit
Public Sub RunLetterWizard (Optional ByRef letterContent As Object, Optional ByRef wizardMode As Object)

Parametry

letterContent
Object

Klasa LetterContent. Wszystkie wypełnione właściwości wyświetlane LetterContent jako wypełnione elementy w kreatorze listów okna dialogowego. Jeśli ten argument zostanie pominięty, GetLetterContent() metoda zostanie automatycznie użyta do pobrania elementu LetterContent z dokumentu.

wizardMode
Object

true aby wyświetlić okno dialogowe Kreator listów jako serię kroków z przyciskami Dalej, Wstecz i Zakończ. false aby wyświetlić okno dialogowe Kreator listów tak, jakby zostało otwarte z menu Narzędzia (okno dialogowe właściwości z przyciskiem OK i przycisk Anuluj). Wartością domyślną jest true.

Przykłady

Poniższy przykład kodu pobiera obiekt LetterContent przez wywołanie CreateLetterContent metody, a następnie wysyła go LetterContent jako parametr do RunLetterWizard metody. Aby użyć tego przykładu ThisDocument , uruchom go z klasy w projekcie na poziomie dokumentu.

private void DocumentRunLetterWizard()
{
    object LetterContent = this.CreateLetterContent(
        DateTime.Now.ToShortDateString(), false, 
        String.Empty, Word.WdLetterStyle.wdFullBlock, true,
        Word.WdLetterheadLocation.wdLetterTop, 24, "Don Hall",
        "100 Main St.\nAnytown, USA",
        "Dear Dave,", Word.WdSalutationType.wdSalutationInformal,
        String.Empty, String.Empty, String.Empty, "End of year report",
        String.Empty, String.Empty, String.Empty, "Sincerely yours,",
        String.Empty, String.Empty, String.Empty, 0, ref missing,
        ref missing, ref missing, ref missing, ref missing, ref missing, 
        ref missing, ref missing);

    object WizardMode = true;

    this.RunLetterWizard(ref LetterContent, ref WizardMode);
    this.SetLetterContent(ref LetterContent);
}
Private Sub DocumentRunLetterWizard()

    Dim LetterContent As Object = Me.CreateLetterContent( _
        DateFormat:=DateTime.Now.ToShortDateString(), IncludeHeaderFooter:=False, _
        PageDesign:=String.Empty, LetterStyle:=Word.WdLetterStyle.wdFullBlock, _
        Letterhead:=True, LetterheadLocation:=Word.WdLetterheadLocation.wdLetterTop, _
        LetterheadSize:=25, RecipientName:="Don Hall", _
        RecipientAddress:="100 Main St." + ControlChars.NewLine + "AnyTown, USA", _
        Salutation:="Dear Dave,", SalutationType:=Word.WdSalutationType.wdSalutationInformal, _
        RecipientReference:=String.Empty, MailingInstructions:=String.Empty, _
        AttentionLine:=String.Empty, Subject:="End of year report", CCList:=String.Empty, _
        ReturnAddress:=String.Empty, SenderName:=String.Empty, Closing:="Sincerely yours,", _
        SenderCompany:=String.Empty, SenderJobTitle:=String.Empty, _
        SenderInitials:=String.Empty, EnclosureNumber:=0)

    Me.RunLetterWizard(LetterContent, True)
    Me.SetLetterContent(LetterContent)
End Sub

Uwagi

Użyj metody , CreateLetterContent aby zwrócić LetterContent element z różnymi właściwościami elementu litery określonymi. Użyj metody , GetLetterContent aby zwrócić element LetterContent na podstawie zawartości dokumentu. Wynikową RunLetterWizard metodą można LetterContent ustawić elementy w Kreatorze listów okno dialogowe.

Parametry opcjonalne

Aby uzyskać informacje na temat parametrów opcjonalnych, zobacz Parametry opcjonalne w rozwiązaniach pakietu Office.

Dotyczy