Skip to content
On this page

Technical Documentation

<< Back

Version independent programming

Given the fact that NetOffice supports all recent versions of Office, a mechanism for determining at designtime and runtime which versions support the functionality in question is needed. Therefore, all entities in NetOffice are annotated with the SupportByLibrary attribute and XML source documentation. Take a look at the following code excerpt:

csharp
///<summary>
/// DispatchInterface _Application SupportByLibrary Excel, 09,10,11,12,14
///</summary>
[SupportByLibrary("Excel", 09,10,11,12,14)]
[EntityTypeAttribute(EntityType.IsDispatchInterface)]
public class _Application : COMObject
{
    /// <summary>
    /// SupportByLibrary Excel 09, 10, 11, 12, 14
    /// </summary>
    [SupportByLibrary("Excel", 09,10,11,12,14)]
    public bool Visible { get; set; }

    /// <summary>
    /// SupportByLibrary Excel 12, 14
    /// </summary>
    [SupportByLibrary("Excel", 12,14)]
    public bool EnableLivePreview { get; set; }

    /// <summary>
    /// SupportByLibrary Excel 14
    /// </summary>
    [SupportByLibrary("Excel", 14)]
    public bool PrintCommunication { get; set; }
}

You can see that the class _Application is present in all supported versions, just like its property Visible. The property EnableLivePreview is only offered in versions 12 and 14, the property PrintCommunication only in version 14. All Classes, Properties, Methoden, Enums, Enum Values, etc. are annotated this way. When you have created an assembly which is using NetOffice, you can check your assembly with the tool NetOffice.DeveloperToolbox with which Office versions your assembly is compatible.

Following you can see an Overview of the different version attributes.

VersionAttributeType Library
Office
Office 200009Microsoft Office 9.0 Object Library
Office 200210Microsoft Office 10.0 Object Library
Office 200311Microsoft Office 11.0 Object Library
Office 200712Microsoft Office 12.0 Object Library
Office 201014Microsoft Office 14.0 Object Library
Excel
Excel 200009Microsoft Excel 9.0 Object Library
Excel 200210Microsoft Excel 10.0 Object Library
Excel 200311Microsoft Excel 11.0 Object Library
Excel 200712Microsoft Excel 12.0 Object Library
Excel 201014Microsoft Excel 14.0 Object Library
Word
Word 200009Microsoft Word 9.0 Object Library
Word 200210Microsoft Word 10.0 Object Library
Word 200311Microsoft Word 11.0 Object Library
Word 200712Microsoft Word 12.0 Object Library
Word 201014Microsoft Word 14.0 Object Library
Outlook
Outlook 200009Microsoft Outlook 9.0 Object Library
Outlook 200210Microsoft Outlook 10.0 Object Library
Outlook 200311Microsoft Outlook 11.0 Object Library
Outlook 200712Microsoft Outlook 12.0 Object Library
Outlook 201014Microsoft Outlook 14.0 Object Library
PowerPoint
PowerPoint 200009Microsoft PowerPoint 9.0 Object Library
PowerPoint 200210Microsoft PowerPoint 10.0 Object Library
PowerPoint 200311Microsoft PowerPoint 11.0 Object Library
PowerPoint 200712Microsoft PowerPoint 12.0 Object Library
PowerPoint 201014Microsoft PowerPoint 14.0 Object Library
Access
Access 200009Microsoft Access 9.0 Object Library
Access 200210Microsoft Access 10.0 Object Library
Access 200311Microsoft Access 11.0 Object Library
Access 200712Microsoft Access 12.0 Object Library
Access 201014Microsoft Access 14.0 Object Library
MSFormsApi.dll
VisioApi.dll
OfficeApi.dll
VBIDEApi.dll
NetOffice.dll
Technical Documentation has loaded