---
id: object/codeunit/5069
type: object
title: Codeunit 5069 "Word Template Interactions"
summary: Codeunit 5069 "Word Template Interactions" in Base Application (Microsoft.CRM.Interaction). 3 public procedures, 7 events. Present since at least BC23, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: null
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: e860ec3b7e857968d344587dcebe6b1b4447110024da1afd6b2773e456cf4a2b
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/CRM/Interaction/WordTemplateInteractions.Codeunit.al
    title: src/Layers/W1/BaseApp/CRM/Interaction/WordTemplateInteractions.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 5069
name: Word Template Interactions
namespace: Microsoft.CRM.Interaction
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 23
  events: 7
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 9
  called_by: 2
  implements: 0
---

# Codeunit 5069 "Word Template Interactions"

> Codeunit 5069 "Word Template Interactions" in Base Application (Microsoft.CRM.Interaction). 3 public procedures, 7 events. Present since at least BC23, still in BC30.

Base Application · Microsoft.CRM.Interaction · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/CRM/Interaction/WordTemplateInteractions.Codeunit.al) · facts from BC29

## Events published

- `OnBeforeCreateInteractionWordTemplate(var WordTemplateCreationWizard: Page "Word Template Creation Wizard")` (integration)
- `OnGetDataSourceOnBeforeRestoreGlobalLanguage(var DataSource: Dictionary of [Text, Text]; var InteractLogEntry: Record "Interaction Log Entry"; var SegLine: Record "Segment Line")` (integration)
- `OnBeforeSendMergedDocument(MergedDocumentInStream: InStream; TempDeliverySorter: Record "Delivery Sorter"; ToAddress: Text; InteractionLogEntry: Record "Interaction Log Entry"; var IsHandled: Boolean)` (integration)
- `OnExecuteMergeOnBeforeMergeWordTemplates(TempDeliverySorter: Record "Delivery Sorter" temporary; InteractLogEntry: Record "Interaction Log Entry"; var SaveFormat: Enum "Word Templates Save Format")` (integration)
- `OnExecuteMergeOnAfterGetInteractLogEntry(InteractionLogEntry: Record "Interaction Log Entry")` (integration)
- `OnGetDataSourceOnBeforeAddDataSources(var DataSource: Dictionary of [Text, Text]; var InteractionLogEntry: Record "Interaction Log Entry"; var Contact: Record Contact; var SalespersonPurchaser: Record "Salesperson/Purchaser"; var CountryRegion: Record "Country/Region"; LineNo: Text; ContactAltAddressCode: Code[10]; LanguageCode: Code[10]; ActiveDate: Date; var IsHandled: Boolean)` (integration)
- `OnExecuteMergeOnBeforeInteractionMergeDataInsert(var InteractionMergeData: Record "Interaction Merge Data"; var InteractionLogEntry: Record "Interaction Log Entry")` (integration)

## Procedures

- `Merge(var TempDeliverySorterWord: Record "Delivery Sorter" temporary)`
- `RunMergedDocument(var SegLine: Record "Segment Line"; var Attachment: Record Attachment)`: Download a merged Word template for a given segment line and attachment.
- `IsWordDocumentExtension(FileExtension: Text): Boolean`: Checks if the provided file extension is a Word document extension.

Plus 13 local procedures.

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 419 "File Management"](../codeunit/419.md) (7 calls: `ExecuteMerge → DeleteServerFile`, `ExecuteMerge → ServerTempFileName`, `Merge → DownloadFromStreamHandler`, …)
- [Codeunit 9987 "Word Template"](../codeunit/9987.md) (6 calls: `ExecuteMerge → GetDocument`, `ExecuteMerge → Load`, `ExecuteMerge → Merge`, …)
- [Codeunit 4100 "Temp Blob"](../codeunit/4100.md) (4 calls: `Merge → CreateInStream`, `Merge → CreateOutStream`, `SendMergedDocument → CreateInStream`, …)
- [Codeunit 425 "Data Compression"](../codeunit/425.md) (4 calls: `EnableZipArchive → CreateZipArchive`, `Merge → CloseZipArchive`, `Merge → SaveZipArchive`, …)
- [Codeunit 3960 "Regex"](../codeunit/3960.md) (2 calls: `GetAllValuesFromHtmlTable → Groups`, `GetAllValuesFromHtmlTable → Match`)
- [Codeunit 5052 "AttachmentManagement"](../codeunit/5052.md) (2 calls: `GetMailToAddress → InteractionEMail`, `GetMergeSourceText → InteractionEMail`)
- [Codeunit 10 "Type Helper"](../codeunit/10.md) (1 call: `GetContactAltAddresses → NewLine`)
- [Codeunit 260 "Document-Mailing"](../codeunit/260.md) (1 call: `SendMergedDocument → EmailFile`)
- [Codeunit 365 "Format Address"](../codeunit/365.md) (1 call: `GetContactAltAddresses → ContactAddrAlt`)

## Called by

- [Codeunit 5052 "AttachmentManagement"](../codeunit/5052.md) (3 calls: `ProcessDeliverySorter → IsWordDocumentExtension`, `Send → Merge`, `SendUsingExchange → Merge`)
- [Table 5062 "Attachment"](../table/5062.md) (2 calls: `ShowAttachment → IsWordDocumentExtension`, `ShowAttachment → RunMergedDocument`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: none

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "Word Template Interactions")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
