Paste from Word

    Let users bring Office content into an Avalonia document through the editor clipboard workflow. Automatic Office detection and the explicit Word-paste command use the shared HTML cleaner.

    The host can inspect incoming HTML through the synchronous Pasting event before it enters the document.

    A project heading and formatted table pasted from an actual Microsoft Word document into Avalonia HTML Editor.
    A project heading and formatted table pasted from an actual Microsoft Word document into Avalonia HTML Editor.

    Use it in your application

    Keep AutoDetectWordPaste enabled for normal paste when Office cleanup is required. Use the explicit command when the application already knows that the clipboard came from Word.

    Run clipboard operations on the UI thread after readiness, with a writable editor. Clipboard availability, image access and Remote Desktop redirection depend on the deployment environment.

    Treat pasted content as input. Apply any application-specific policy before storing or sending it; keep the editor resource policy aligned with your workflow.

    editor.Options.AutoDetectWordPaste = true;
    await editor.Editor.PasteFromMsWordAsync();
    

    Related guides

    Last updated on Nov 5, 2026

    Put this into practice.

    Start with the C# Avalonia sample. Restore this edition's package and install the native browser prerequisites before running it.

    Prefer a guided look? Book a free live demo with our engineers - live on Zoom or Teams, never a chatbot.