Skip to main content

Notifications

Power Automate - Building Flows
Suggested answer

Converting Email Body to a Word Document in Power Automate (Without OneDrive for Business)

(0) ShareShare
ReportReport
Posted on by 6

I’m trying to convert the body of an email into a Word document (.docx) and upload it to SharePoint using Power Automate.

Currently, I have a flow set up that triggers when an email is received. It converts the email’s HTML content to plain text, but I’m running into issues when trying to create the Word document.

When I use the SharePoint "Create file" action and specify a .docx extension, the file gets created successfully. However, when I try to open it in Word, I receive an error stating that the content is unreadable. I'm unsure how to properly format the text so that Word recognizes it correctly.

Additionally, I want to ensure that each generated file has a unique name to avoid conflicts. I would prefer to avoid using OneDrive for Business, as I don’t want files stored locally or tied to a specific user account. However, if OneDrive is the only solution, I could add an extra step to delete the file after processing.

How can I properly populate the email body into a Word document so that it opens without errors? Is there a way to do this directly in SharePoint without relying on OneDrive?

Any guidance would be greatly appreciated!

  • AlexEncodian Profile Picture
    AlexEncodian 4,302 on at
    Converting Email Body to a Word Document in Power Automate (Without OneDrive for Business)
    As Nived mentioned, I would populate a word template with the email body and create the populated docx in SharePoint. The main consideration is whether formatting is important to you. 
     
    The Word connector does not support HTML / rich text so you would convert "HTML to text" and insert the email as a string.
     
    If you want to maintain the formatting, you use Encodian to populate the word document with HTML:

    Populate Word Document – Encodian Customer Help
  • Suggested answer
    Nived_Nambiar Profile Picture
    Nived_Nambiar 17,039 on at
    Converting Email Body to a Word Document in Power Automate (Without OneDrive for Business)
     
    There is another way to try this - create a word template and use populate word template action to populate the email content inside it. Then use content generated from that action in Create File action.
     
     
    Another way is to via using convert file action in onedrive , temporarily creating files and then creating same file in sharepoint using onedrive file content
     

    Thanks & Regards,
    Nived N

    Stay connected:
    LinkedIn | YouTube | Blogs

    Was this answer helpful?
    If yes, please mark it as the solution by selecting the checkbox in the discussion thread.
    Your feedback motivates me to keep contributing. Thank you!

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard