Document.RunLetterWizard Method
Assembly: Microsoft.Office.Tools.Word (in microsoft.office.tools.word.dll)
public virtual void RunLetterWizard ( [OptionalAttribute] ref Object LetterContent, [OptionalAttribute] ref Object WizardMode )
Parameters
- LetterContent
A LetterContent. Any filled properties in the LetterContent show up as filled elements in the Letter Wizard dialog boxes. If this argument is omitted, the GetLetterContent method is automatically used to get a LetterContent from the document.
- WizardMode
true to display the Letter Wizard dialog box as a series of steps with Next, Back, and Finish buttons. false to display the Letter Wizard dialog box as if it were opened from the Tools menu (a properties dialog box with an OK button and a Cancel button). The default value is true.
Use the CreateLetterContent method to return a LetterContent with various letter element properties specified. Use the GetLetterContent method to return a LetterContent based on the contents of the document. You can use the resulting LetterContent with the RunLetterWizard method to set elements in the Letter Wizard dialog box.
Optional Parameters
For information on optional parameters, see Understanding Optional Parameters in COM Interop.
The following code example gets a LetterContent by calling the CreateLetterContent method, and then sends this LetterContent as a parameter to the RunLetterWizard method.
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); }