---
title: "Codeunit 5069 Word Template Interactions, extension points 29"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/points/
object: https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/
app: "Base Application"
major: 29
source: https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/
checked: 2026-11-20
changed: 2026-10-05
subject: "Microsoft Dynamics 365 Business Central"
license: "Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/"
---

# Codeunit 5069 Word Template Interactions, extension points 29

JOP-AL, https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/points/

13 procedures and triggers with a step in src/Layers/W1/BaseApp/CRM/Interaction/WordTemplateInteractions.Codeunit.al, in source order, read from the text, not from a run.

## Merge

[Line 27](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L27).

- [67](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L67) calls `EnableZipArchive`
- [75](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L75) calls `ExecuteMerge`
- [76](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L76) writes [Table 5074 Delivery Sorter](https://jonas-paprotka.de/ref/table/5074-delivery-sorter/) DeleteAll
- [80](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L80) writes [Table 5074 Delivery Sorter](https://jonas-paprotka.de/ref/table/5074-delivery-sorter/) Insert
- [90](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L90) calls `ExecuteMerge`
- [92](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L92) calls `IsZipArchive`
- [93](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L93) calls [Codeunit 4100 Temp Blob](https://jonas-paprotka.de/ref/codeunit/4100-temp-blob/) `CreateOutStream`
- [94](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L94) calls [Codeunit 425 Data Compression](https://jonas-paprotka.de/ref/codeunit/425-data-compression/) `SaveZipArchive`
- [95](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L95) calls [Codeunit 425 Data Compression](https://jonas-paprotka.de/ref/codeunit/425-data-compression/) `CloseZipArchive`
- [96](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L96) calls [Codeunit 4100 Temp Blob](https://jonas-paprotka.de/ref/codeunit/4100-temp-blob/) `CreateInStream`
- [101](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L101) calls [Codeunit 419 File Management](https://jonas-paprotka.de/ref/codeunit/419-file-management/) `DownloadFromStreamHandler`

## ExecuteMerge

[Line 106](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L106), local.

- [140](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L140) raises `OnExecuteMergeOnBeforeInteractionMergeDataInsert`
- [141](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L141) writes [Table 5106 Interaction Merge Data](https://jonas-paprotka.de/ref/table/5106-interaction-merge-data/) Insert
- [143](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L143) calls `GetMailToAddress`
- [150](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L150) calls [Codeunit 9987 Word Template](https://jonas-paprotka.de/ref/codeunit/9987-word-template/) `Load`
- [152](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L152) calls [Codeunit 9987 Word Template](https://jonas-paprotka.de/ref/codeunit/9987-word-template/) `Load`
- [155](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L155) raises `OnExecuteMergeOnBeforeMergeWordTemplates`
- [157](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L157) calls [Codeunit 9987 Word Template](https://jonas-paprotka.de/ref/codeunit/9987-word-template/) `Merge`
- [158](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L158) calls [Codeunit 9987 Word Template](https://jonas-paprotka.de/ref/codeunit/9987-word-template/) `GetDocument`
- [159](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L159) calls `SendMergedDocument`
- [160](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L160) writes [Table 5106 Interaction Merge Data](https://jonas-paprotka.de/ref/table/5106-interaction-merge-data/) Delete
- [170](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L170) calls [Codeunit 9987 Word Template](https://jonas-paprotka.de/ref/codeunit/9987-word-template/) `Load`
- [172](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L172) calls [Codeunit 9987 Word Template](https://jonas-paprotka.de/ref/codeunit/9987-word-template/) `Load`
- [175](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L175) calls [Codeunit 9987 Word Template](https://jonas-paprotka.de/ref/codeunit/9987-word-template/) `Merge`
- [177](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L177) calls [Codeunit 9987 Word Template](https://jonas-paprotka.de/ref/codeunit/9987-word-template/) `Merge`
- [178](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L178) calls [Codeunit 9987 Word Template](https://jonas-paprotka.de/ref/codeunit/9987-word-template/) `GetDocument`
- [185](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L185) calls [Codeunit 9987 Word Template](https://jonas-paprotka.de/ref/codeunit/9987-word-template/) `Load`
- [186](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L186) calls [Codeunit 9987 Word Template](https://jonas-paprotka.de/ref/codeunit/9987-word-template/) `Merge`
- [187](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L187) calls [Codeunit 9987 Word Template](https://jonas-paprotka.de/ref/codeunit/9987-word-template/) `GetDocument`
- [190](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L190) calls `SendMergedDocument`
- [191](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L191) writes [Table 5106 Interaction Merge Data](https://jonas-paprotka.de/ref/table/5106-interaction-merge-data/) Delete
- [203](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L203) calls [Codeunit 419 File Management](https://jonas-paprotka.de/ref/codeunit/419-file-management/) `ServerTempFileName`
- [206](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L206) calls `IsWordDocumentExtension`
- [209](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L209) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `ExportAttachmentToServerFile`
- [218](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L218) raises `OnExecuteMergeOnAfterGetInteractLogEntry`
- [220](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L220) calls `GetMergeSourceText`
- [221](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L221) calls `GetDataSource`
- [222](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L222) calls `GetMergedDocumentStream`
- [223](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L223) calls `SendMergedDocument`
- [229](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L229) calls `IsZipArchive`
- [230](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L230) calls `EnableZipArchive`
- [234](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L234) calls `GetMailToAddress`
- [235](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L235) calls `GetDataSource`
- [236](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L236) calls `GetMergedDocumentStream`
- [237](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L237) calls `SendMergedDocument`
- [243](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L243) calls [Codeunit 419 File Management](https://jonas-paprotka.de/ref/codeunit/419-file-management/) `DeleteServerFile`
- [252](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L252) writes [Table 5065 Interaction Log Entry](https://jonas-paprotka.de/ref/table/5065-interaction-log-entry/) Modify

## GetMailToAddress

[Line 258](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L258), local.

- [263](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L263) calls [Codeunit 5052 AttachmentManagement](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/) `InteractionEMail`

## SendMergedDocument

[Line 269](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L269), local.

- [286](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L286) raises `OnBeforeSendMergedDocument`, IsHandled
- [306](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L306) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `SetAttachmentFileFromStream`
- [318](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L318) calls [Codeunit 260 Document-Mailing](https://jonas-paprotka.de/ref/codeunit/260-document-mailing/) `EmailFile`
- [320](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L320) calls [Codeunit 4100 Temp Blob](https://jonas-paprotka.de/ref/codeunit/4100-temp-blob/) `CreateOutStream`
- [324](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L324) calls [Codeunit 4100 Temp Blob](https://jonas-paprotka.de/ref/codeunit/4100-temp-blob/) `CreateInStream`
- [325](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L325) calls [Codeunit 260 Document-Mailing](https://jonas-paprotka.de/ref/codeunit/260-document-mailing/) `EmailFile`
- [327](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L327) writes [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) Insert(true)
- [330](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L330) writes [Table 5065 Interaction Log Entry](https://jonas-paprotka.de/ref/table/5065-interaction-log-entry/) Modify
- [335](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L335) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `SetAttachmentFileFromStream`
- [337](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L337) writes [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) Insert(true)
- [340](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L340) writes [Table 5065 Interaction Log Entry](https://jonas-paprotka.de/ref/table/5065-interaction-log-entry/) Modify
- [342](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L342) calls `IsZipArchive`
- [345](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L345) calls [Codeunit 419 File Management](https://jonas-paprotka.de/ref/codeunit/419-file-management/) `GetSafeFileName`
- [347](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L347) calls [Codeunit 419 File Management](https://jonas-paprotka.de/ref/codeunit/419-file-management/) `GetSafeFileName`
- [348](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L348) calls [Codeunit 425 Data Compression](https://jonas-paprotka.de/ref/codeunit/425-data-compression/) `AddEntry`
- [353](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L353) calls [Codeunit 419 File Management](https://jonas-paprotka.de/ref/codeunit/419-file-management/) `GetSafeFileName`
- [355](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L355) calls [Codeunit 419 File Management](https://jonas-paprotka.de/ref/codeunit/419-file-management/) `DownloadFromStreamHandler`

## GetMergedDocumentStream

[Line 362](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L362), local.

- [369](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L369) calls `GetMergedDocument`
- [371](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L371) calls `GetMergedDocument`

## RunMergedDocument

[Line 380](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L380).

- [388](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L388) calls `IsWordDocumentExtension`
- [391](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L391) calls [Codeunit 419 File Management](https://jonas-paprotka.de/ref/codeunit/419-file-management/) `ServerTempFileName`
- [393](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L393) calls [Table 5062 Attachment](https://jonas-paprotka.de/ref/table/5062-attachment/) `ExportAttachmentToServerFile`
- [398](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L398) calls `GetMergeSourceText`
- [399](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L399) calls `GetDataSource`
- [401](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L401) calls `GetDataSource`
- [404](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L404) calls `GetMergedDocument`
- [405](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L405) calls [Codeunit 419 File Management](https://jonas-paprotka.de/ref/codeunit/419-file-management/) `DeleteServerFile`

## GetMergedDocument

[Line 408](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L408), local.

- [416](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L416) calls [Codeunit 9987 Word Template](https://jonas-paprotka.de/ref/codeunit/9987-word-template/) `Load`
- [419](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L419) calls [Codeunit 9987 Word Template](https://jonas-paprotka.de/ref/codeunit/9987-word-template/) `Merge`
- [420](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L420) calls [Codeunit 9987 Word Template](https://jonas-paprotka.de/ref/codeunit/9987-word-template/) `GetDocument`

## GetMergeSourceText

[Line 434](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L434), local.

- [474](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L474) calls [Codeunit 5052 AttachmentManagement](https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/) `InteractionEMail`

## GetDataSource

[Line 483](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L483), local.

- [491](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L491) calls `GetAllValuesFromHtmlTable`

## GetAllValuesFromHtmlTable

[Line 505](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L505), local.

- [514](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L514) calls [Codeunit 3960 Regex](https://jonas-paprotka.de/ref/codeunit/3960-regex/) `Match`
- [516](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L516) calls [Codeunit 3960 Regex](https://jonas-paprotka.de/ref/codeunit/3960-regex/) `Groups`
- [518](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L518) calls [Table 3964 Groups](https://jonas-paprotka.de/ref/table/3964-groups/) `ReadValue`

## GetDataSource

[Line 523](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L523), local.

- [543](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L543) calls `InitMergeFields`
- [552](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L552) calls [Codeunit 43 Language](https://jonas-paprotka.de/ref/codeunit/43-language/) `GetLanguageIdOrDefault`
- [567](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L567) raises `OnGetDataSourceOnBeforeAddDataSources`, IsHandled
- [570](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L570) calls `GetContactAltAddresses`
- [588](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L588) calls [Table 5050 Contact](https://jonas-paprotka.de/ref/table/5050-contact/) `GetSalutation`
- [589](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L589) calls [Table 5050 Contact](https://jonas-paprotka.de/ref/table/5050-contact/) `GetSalutation`
- [628](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L628) raises `OnGetDataSourceOnBeforeRestoreGlobalLanguage`

## GetContactAltAddresses

[Line 655](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L655), local.

- [663](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L663) calls [Codeunit 365 Format Address](https://jonas-paprotka.de/ref/codeunit/365-format-address/) `ContactAddrAlt`
- [666](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L666) calls [Codeunit 10 Type Helper](https://jonas-paprotka.de/ref/codeunit/10-type-helper/) `NewLine`
- [668](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L668) calls [Codeunit 10 Type Helper](https://jonas-paprotka.de/ref/codeunit/10-type-helper/) `NewLine`

## EnableZipArchive

[Line 676](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L676), local.

- [679](https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/source/#L679) calls [Codeunit 425 Data Compression](https://jonas-paprotka.de/ref/codeunit/425-data-compression/) `CreateZipArchive`

## Source

AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at 4303e5e584d3aa5d9e98cbc615525a5396ad6ed7.

JOP-AL, 2026-11-20.
