web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to embed attachmen...
Power Automate
Unanswered

How to embed attachments (file) into Word document template using power automate cloud flow?

(0) ShareShare
ReportReport
Posted on by 6

I’m working on a project where I need to embed an attachment file (e.g., a PDF or Excel file) into a Word template as an object, with icon(show icon enabled). I am using Power Automate Cloud Flows for this task.

Does anyone have experience or ideas on how to achieve this? Any guidance, examples, or workaround solutions would be greatly appreciated!

Thank you in advance!

Categories:
I have the same question (0)
  • Suggested answer
    Ninjasabi Profile Picture
    122 on at

    Embedding an attachment (e.g., PDF or Excel file) as an object into a Word document using Power Automate Cloud Flow is not natively supported as a direct feature. However, you can use a combination of Power Automate and other tools (like Office Scripts, Word Online, or desktop automation) to achieve this. Here's how you can approach this:


    Solution Options:

    Option 1: Use a Desktop Flow with Power Automate

    Power Automate Desktop (PAD) can interact with Word Desktop to embed the attachment as an object.

    1. Setup Power Automate Cloud Flow:

      • Use a trigger (e.g., "When a file is created" or manual trigger) to initiate the flow.
      • Pass the attachment file (e.g., PDF or Excel) and Word document template path to the desktop flow.
    2. Create a Power Automate Desktop Flow:

      • Open the Word template.
      • Use the "Insert Object" functionality in Word Desktop:
        • Navigate to Insert > Object > Create from File in Word Desktop.
        • Enable "Show as Icon."
        • Select the file path dynamically passed from the cloud flow.
    3. Save the Word Document:

      • Save the updated Word document with the embedded file.
    4. Return to Cloud Flow (if needed):

      • You can pass the updated document back to the SharePoint or OneDrive location via the cloud flow.

    Option 2: Use Office Scripts with Excel/SharePoint Integration

    If you have an environment with Office Scripts and Graph API enabled, you could:

    1. Create a custom Office Script or use a Graph API request to embed objects into a Word document.
    2. Automate the script execution via Power Automate.

    However, this option requires custom scripting and is better suited for advanced users with programming capabilities.


    Option 3: Workaround with Attachments as Hyperlinks

    If embedding the file as an object is not mandatory, you can link the file in the Word document as a hyperlink.

    1. Upload Attachments to SharePoint:

      • Use the cloud flow to upload the file to SharePoint or OneDrive.
      • Generate a shared link for the file.
    2. Update Word Template:

      • Use the "Populate a Microsoft Word template" action to insert the hyperlink into the Word document at the desired location.

    Why Native Cloud Flow Support for Embedding Objects Is Limited

    Power Automate Cloud Flow is designed for document automation but lacks the ability to directly embed objects in Word due to the complex binary structure of embedded objects in Word files. Using desktop automation or scripting provides a workaround.


    Tips:

    • If you opt for the desktop flow, ensure Power Automate Desktop is installed and configured with necessary permissions.
    • For frequent use, consider automating the task end-to-end using a hybrid approach with desktop flow for embedding and cloud flow for triggering and managing file storage.

    Let me know if you’d like detailed guidance for implementing any of these options!

    Best regards,
    @Ninjasabi

  • DP_Gunta Profile Picture
    6 on at
    @Ninjasabi I did get this far with the help of GPT but was not able to understand how to go about using option 2. Can you share a working example of the solution if you have one. Or any blogs/documentations that i can go through to acquire the same

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard