---
id: post/yzhums-com/64042
type: post
title: "Dynamics 365 Business Central: Convert Word (.docx) To HTML (.html) within BC (No control add-in and APIs)"
summary: "Converting Word (.docx) files to HTML (.html) format within Business Central using the built-in ConvertWordToHtml procedure from codeunit 9651 without requiring control add-ins or external APIs. The post demonstrates two practical approaches: converting attachments in Document Attachment Details and uploading Word documents for conversion."
tier: community
language: en
tags:
  - word layout
  - document conversion
  - html
  - document attachment
  - file handling
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-26T06:42:40.305Z"
  flags: []
generated:
  at: "2026-10-26T08:08:59.782Z"
  pipeline: 0.2.0
  prompts:
    extract-post: 1
  input_hash: faa2b3a277b51505af163e5c5b306f369ab694cb25bcb95f244f386798102ff7
evidence:
  - kind: blog
    url: https://yzhums.com/64042/
    title: "Dynamics 365 Business Central: Convert Word (.docx) To HTML (.html) within BC (No control add-in and APIs)"
    date: "2025-05-14"
    commit: null
    t: null
    quote: null
  - kind: blog
    url: https://yzhums.com/64042/
    title: "Dynamics 365 Business Central: Convert Word (.docx) To HTML (.html) within BC (No control add-in and APIs)"
    date: "2025-05-14"
    commit: null
    t: null
    quote: If you encounter a file that cannot be converted, the following error message will be displayed
links:
  learn: []
  objects:
    - object/codeunit/9651
    - object/codeunit/4100
    - object/codeunit/419
    - object/table/1173
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/ai/ai-development-toolkit-attachments
      title: Attachment capabilities and limitations (preview)
      label: possibly related
      why: names Codeunit 4100 "Temp Blob"
      by: code
    - to: post/yzhums-com/63595
      title: "Dynamics 365 Business Central: Convert Word (.docx) To PDF (.pdf) within BC (No control add-in and APIs)"
      label: possibly related
      why: both name Codeunit 9651 "Document Report Mgt."
      by: code
    - to: post/yzhums-com/65522
      title: "Dynamics 365 Business Central: Generate Swiss QR Code without external services/APIs"
      label: possibly related
      why: both name Codeunit 4100 "Temp Blob"
      by: code
    - to: post/yzhums-com/68624
      title: "Dynamics 365 Business Central: How to get the page number of a PDF or Word file in AL (Display the page count on Attached Documents and Doc. Attachment List Factbox)"
      label: possibly related
      why: both name Table 1173 "Document Attachment"
      by: code
    - to: post/yzhums-com/66463
      title: "Dynamics 365 Business Central: How to prevent users from uploading duplicate files as attachments (Duplicate file names)"
      label: possibly related
      why: both name Table 1173 "Document Attachment"
      by: code
    - to: post/yzhums-com/63942
      title: "Dynamics 365 Business Central: How to preview Word (.docx) in web client without downloading (No control add-in and APIs)"
      label: possibly related
      why: both name Codeunit 9651 "Document Report Mgt."
      by: code
    - to: post/yzhums-com/66461
      title: "Dynamics 365 Business Central: How to quickly strip not supported chars in File Name via AL"
      label: possibly related
      why: both name Codeunit 419 "File Management"
      by: code
    - to: post/demiliani-com/12623
      title: "Dynamics 365 Business Central: previewing PDF files in web client using the new ExtendedDataType = Document."
      label: possibly related
      why: both name Codeunit 419 "File Management"
      by: code
    - to: post/gerardorenteria-blog/11203
      title: New Application Ideas of Dynamics 365 Business Central (2025 MAY)
      label: possibly related
      why: both name Table 1173 "Document Attachment"
      by: code
    - to: post/aardvarklabs-blog/2202
      title: Step by Step Guide to Importing Excel Data into Business Central
      label: possibly related
      why: both name Codeunit 419 "File Management"
      by: code
post_id: "64042"
source_id: yzhums-com
source_name: Dynamics 365 Lab - Yun Zhu
url: https://yzhums.com/64042/
published_at: "2025-05-14T00:46:13.000Z"
author: Yun Zhu
full_text: false
words: 496
quotes:
  - text: If you encounter a file that cannot be converted, the following error message will be displayed
    why_it_matters: Alerts developers to potential conversion failures with unsupported Word document structures and helps with error handling
code_objects_mentioned:
  - codeunit Document Report Mgt.
  - codeunit Temp Blob
  - codeunit File Management
  - table Document Attachment
  - other DocumentAttachmentDetailsExt
  - other CustomerListExt
systems:
  - development
versions_mentioned:
  - Business Central 2023 wave 2 (BC23)
cautions:
  - kind: warning
    quote: If you encounter a file that cannot be converted, the following error message will be displayed.
    objects:
      - type: codeunit
        name: Document Report Mgt.
    events: []
    versions: []
preview:
  embeddable: true
  frame_url: null
  image: https://yzhums.com/wp-content/uploads/2025/05/Snipaste_2025-05-13_14-50-10.png
  image_alt: null
  image_w: null
  image_h: null
  site_name: Dynamics 365 Lab
  favicon: https://yzhums.com/wp-content/uploads/2020/08/cropped-logo-3-32x32.png
  probed_at: "2026-10-26T06:20:39.530Z"
---

# Dynamics 365 Business Central: Convert Word (.docx) To HTML (.html) within BC (No control add-in and APIs)

[Read the post](https://yzhums.com/64042/) · Dynamics 365 Lab - Yun Zhu (Yun Zhu, MVP) · 2025-05-14 · 496 words · tier community · reviewed (checked by Opus)

> Converting Word (.docx) files to HTML (.html) format within Business Central using the built-in ConvertWordToHtml procedure from codeunit 9651 without requiring control add-ins or external APIs. The post demonstrates two practical approaches: converting attachments in Document Attachment Details and uploading Word documents for conversion.

## Key points

- Business Central provides a standard method via codeunit 9651 'Document Report Mgt.' with the ConvertWordToHtml procedure
- The conversion can be performed on Word files stored as document attachments or uploaded directly
- Implementation uses TempBlob codeunit to handle file streaming and conversion
- Some Word documents with unsupported package content may fail conversion with a specific error message

## Quotes

- "If you encounter a file that cannot be converted, the following error message will be displayed" (Alerts developers to potential conversion failures with unsupported Word document structures and helps with error handling)

## AL objects mentioned

As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.

- [codeunit 9651 "Document Report Mgt."](../../objects/codeunit/9651.md)
- [codeunit 4100 "Temp Blob"](../../objects/codeunit/4100.md)
- [codeunit 419 "File Management"](../../objects/codeunit/419.md)
- [table 1173 "Document Attachment"](../../objects/table/1173.md)
- other "DocumentAttachmentDetailsExt"
- other "CustomerListExt"

## Possibly related

No source states these links: they share an object, a model read them, or a person found the same subject.

- [Attachment capabilities and limitations (preview)](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/ai/ai-development-toolkit-attachments) — possibly related: names Codeunit 4100 "Temp Blob"
- [Dynamics 365 Business Central: Convert Word (.docx) To PDF (.pdf) within BC (No control add-in and APIs)](../../posts/yzhums-com/63595.md) — possibly related: both name Codeunit 9651 "Document Report Mgt."
- [Dynamics 365 Business Central: Generate Swiss QR Code without external services/APIs](../../posts/yzhums-com/65522.md) — possibly related: both name Codeunit 4100 "Temp Blob"
- [Dynamics 365 Business Central: How to get the page number of a PDF or Word file in AL (Display the page count on Attached Documents and Doc. Attachment List Factbox)](../../posts/yzhums-com/68624.md) — possibly related: both name Table 1173 "Document Attachment"
- [Dynamics 365 Business Central: How to prevent users from uploading duplicate files as attachments (Duplicate file names)](../../posts/yzhums-com/66463.md) — possibly related: both name Table 1173 "Document Attachment"
- [Dynamics 365 Business Central: How to preview Word (.docx) in web client without downloading (No control add-in and APIs)](../../posts/yzhums-com/63942.md) — possibly related: both name Codeunit 9651 "Document Report Mgt."
- [Dynamics 365 Business Central: How to quickly strip not supported chars in File Name via AL](../../posts/yzhums-com/66461.md) — possibly related: both name Codeunit 419 "File Management"
- [Dynamics 365 Business Central: previewing PDF files in web client using the new ExtendedDataType = Document.](../../posts/demiliani-com/12623.md) — possibly related: both name Codeunit 419 "File Management"
- [New Application Ideas of Dynamics 365 Business Central (2025 MAY)](../../posts/gerardorenteria-blog/11203.md) — possibly related: both name Table 1173 "Document Attachment"
- [Step by Step Guide to Importing Excel Data into Business Central](../../posts/aardvarklabs-blog/2202.md) — possibly related: both name Codeunit 419 "File Management"

## Heads up

- warning: "If you encounter a file that cannot be converted, the following error message will be displayed." (about codeunit Document Report Mgt.)

## Context

- Features: HTML output, document attachment handling, file upload and conversion, stream processing
- Versions: Business Central 2023 wave 2 (BC23)

Source: Dynamics 365 Lab - Yun Zhu, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.
