---
title: "Codeunit 1631 Office Host Management"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/codeunit/1631-office-host-management/
type: codeunit
id: 1631
name: "Office Host Management"
app: "Base Application"
namespace: Microsoft.CRM.Outlook
versions: "17-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/codeunit/1631-office-host-management/source/29/"
checked: 2026-09-20
subject: "Microsoft Dynamics 365 Business Central"
license: "Content © 2026 Jonas Paprotka. Quote freely with attribution and a link."
---

# Codeunit 1631 Office Host Management

Jonas Paprotka, https://jonas-paprotka.de/ref/codeunit/1631-office-host-management/

| | |
| --- | --- |
| App | Base Application |
| Namespace | Microsoft.CRM.Outlook |
| Versions | 17-28 |
| Source file | CRM/Outlook/OfficeHostManagement.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| InitializeHost | (DotNet OfficeHost, Text) | - | public | 17-28 | - | - |
| InitializeContext | (Record Office Add-in Context) | - | public | 17-28 | - | - |
| InitializeExchangeObject | () | - | public | 17-28 | - | - |
| GetHostName | () | Text | public | 17-28 | - | - |
| GetHostType | () | Text | public | 17-28 | - | - |
| CloseCurrentPage | () | - | public | 17-28 | - | - |
| InvokeExtension | (Text, Variant, Variant, Variant, Variant) | - | public | 17-28 | - | - |
| IsAvailable | () | Boolean | public | 17-28 | - | - |
| GetTempOfficeAddinContext | (var Record Office Add-in Context) | - | public | 17-28 | - | - |
| SendToOCR | (Record Incoming Document) | - | public | 17-28 | - | - |
| EmailHasAttachments | () | Boolean | public | 17-28 | - | - |
| GetEmailAndAttachments | (var Record Exchange Object, Option, Code[20]) | - | public | 17-22 | Pending 20.0 | Please use GetEmailAndAttachments which uses RecordRef instead of Vendor number. |
| GetEmailBody | (Record Office Add-in Context) | Text | public | 17-28 | - | - |
| GetFinancialsDocument | (Record Office Add-in Context) | Text | public | 17-28 | - | - |
| CheckHost | () | - | public | 17-28 | - | - |
| GetEmailAndAttachments | (var Record Exchange Object, Option, RecordRef) | - | public | 20-28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnInitializeHost | (DotNet OfficeHost, Text) | 17-28 | - | - |
| Integration event | OnInitializeContext | (Record Office Add-in Context) | 17-28 | - | - |
| Integration event | OnInitializeExchangeObject | () | 17-28 | - | - |
| Integration event | OnGetHostName | (var Text) | 17-28 | - | - |
| Integration event | OnGetHostType | (var Text) | 17-28 | - | - |
| Integration event | OnCloseCurrentPage | () | 17-28 | - | - |
| Integration event | OnInvokeExtension | (Text, Variant, Variant, Variant, Variant) | 17-28 | - | - |
| Integration event | OnIsHostInitialized | (var Boolean) | 17-28 | - | - |
| Integration event | OnIsAvailable | (var Boolean) | 17-28 | - | - |
| Integration event | OnGetTempOfficeAddinContext | (var Record Office Add-in Context) | 17-28 | - | - |
| Integration event | OnSendToOCR | (Record Incoming Document) | 17-28 | - | - |
| Integration event | OnEmailHasAttachments | (var Boolean) | 17-28 | - | - |
| Integration event | OnGetEmailAndAttachments | (var Record Exchange Object, Option, Code[20]) | 17-22 | Pending 20.0 | Please use OnGetEmailAndAttachmentsForEntity which uses RecordRef instead of Vendor number. |
| Integration event | OnGetEmailBody | (Text[250], var Text) | 17-28 | - | - |
| Integration event | OnGetFinancialsDocument | (Text[250], var Text) | 17-28 | - | - |
| Integration event | OnGetEmailAndAttachmentsForEntity | (var Record Exchange Object, Option, RecordRef) | 20-28 | - | - |

## Source

Symbols: Microsoft.BaseApplication.symbols.437dbf0e-84ff-417a-965d-ed2bb9650972, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-09-20.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at a66254c3b8b5bb1cea290dc8f9d097aec4381153.

Jonas Paprotka, 2026-09-20.
