Skip to main content

Outlook Add-in User Guide

1. Overview

This add-in adopts two unified operation modes in the Outlook Reading/New/Reply scenarios:

  • Selection Mode: When you select text in the body → the "Selection Tools" button is displayed.
  • Mail Mode: When no text is selected → the "Whole Mail Tools" button is displayed.

Only when replying to an email will the "Generate Reply" button be additionally displayed. Other functions are consistent with Word/PPT logic (distinguished by selection/whole mail).

A Close button is provided in the upper right corner to clear the current session.


2. Feature Overview (by Mode)

2.1 Selection Mode (when text is selected)

  • Translate Selection
    Translates the selected text into the target language and automatically writes back to replace the original text (using addHtmlTextToSelection, retaining HTML structure).
  • Rewrite & Optimize
    Stylizes and rewrites the selected text: rewrite / simplify / expand / list / outline, and automatically writes back to replace the original text (addHtmlTextToSelection).
  • Explain Selection
    Outputs a clear explanation of the selected text (only outputs the result, does not write back automatically).
  • Proofread Selection
    Only corrects spelling and grammar errors without changing the original meaning (only outputs the corrected text, does not write back automatically).

2.2 Mail Mode (when no text is selected)

  • Translate Whole Mail
    Reads the content from the current email body (getCurrentBody), translates it into the target language (by default only outputs the result, does not write back automatically).
  • Explain Whole Mail
    Reads the entire content and outputs a concise explanation (only outputs).
  • Summarize Whole Mail
    Generates a concise summary retaining key points (only outputs).

2.3 Only Displayed in "Reply Email" Scenario

  • Generate Reply
    Automatically reads the replied email (getRepliedBody), generates a complete reply according to the selected tone (formal/friendly/concise, etc.), and writes back to the body (setBodyHtmlContent).

3. Typical Operations

A. Translate Selected Text and Write Back

  1. Select a segment of text in the email body
  2. Click Translate → Choose Language
  3. The system will directly replace the original text with the translation (retaining HTML structure and style)

B. Summarize Whole Mail

  1. Do not select any text
  2. Click Summarize
  3. The panel displays the summary (does not modify the body)

C. One-Click Generate Reply When Replying to Email

  1. Click Outlook's Reply/Reply All
  2. Open the add-in, click Generate Reply → Choose Tone
  3. The system automatically reads the original email and writes the generated reply into the body

D. Rewrite Selection as "List"

  1. Select a long segment of text
  2. Click Rewrite & Optimize → List
  3. The original text is replaced with a bulleted list (write-back takes effect)

4. Button Display Rules (Important)

  • Whether text is selected determines whether "Selection Tools" or "Whole Mail Tools" are displayed.
  • When in the reply window (Reply/Reply All), additionally display "Generate Reply".
  • Reading, new, and reply scenarios use the same set of button logic (based on whether text is selected).

5. Notes & Known Behaviors

  • Write-back Behavior:

    • "Translate/Rewrite" for selection will write back to replace the original text;
    • "Explain/Summarize/Whole Mail Translate/Proofread" by default only output results, do not write back to the body;
    • "Generate Reply" will write back to the body (reply scenario only).
  • Format Retention: Selection write-back uses addHtmlTextToSelection to retain the original HTML structure and style as much as possible.

  • Check Before Sending: Automatically generated/translated content is for assistance only; manual review is recommended before sending.

  • If the body is permission restricted (read-only/encrypted), write-back will fail and a prompt should be given.