Microsoft Dynamics 365 Blog

In this blog you will find the source code (below) to “let NAV speak.” You would have a wide range of possibilities to use this simple Add-in and enlarge this project.

If you want to know more about Client Add-ins you can refer to this MSDN link:

Extending the RoleTailored Client Using Control Add-ins and Microsoft Dynamics NAV 2009 SP1

This simple Client Add-In is based on System.Speech namespace:

Microsoft.Speech.Synthesis Namespace

Step by step creation of the NSpeech Add-In

(Remember the ‘DodgeBall’ rules: Develop, Sign, Place, Register and Develop)

  1. DEVELOP your add-in (in Visual Studio)
  2. Strong SIGN and build
  3. PLACE DLLs into Add-ins folder
  4. REGISTER the add-in in Table 2000000069, Client Add-in
  5. DEVELOP your C/AL code (in Object Designer)

A. Create a New Class Project

  1. Open Visual Studio (in this example I am using Visual Studio 2010)
  2. Create a New Project (CTRL+SHIFT+N) with these parameters
    • Visual C# – Windows
    • Class library
    • .NET Framework 3.5
    • Name: NSpeech
    • Location: C:\TMP (or whatever location you like)
    • Solution Name: NSpeech
    • Create directory for solution


B. Create a Strong Name Key (SNK)

  1. Go to Project > Properties (NSpeech Properties…)
  2. From the Project Properties form go to the Signing tab
  3. Tick the Sign the assembly option
  4. Create a New SNK (e.g. TestSpeechNav.snk)


C. Add References to the Project

  1. Click on the Class1.cs tab (return to the project)
  2. In the Solution Explorer window select Reference, right Click, Add Reference
  3. Add reference to
    • Microsoft.Dynamics.Framework.UI.Extensibility (Version (By default, the path to the assembly is C:\Program Files\Microsoft Dynamics NAV\60\RoleTailored Client)
    • System.Drawing (Version
    • System.Speech (Version
    • System.Windows.Forms (Version


D. Develop your NSpeech Project

(You can simply copy and paste this code into your Class project.)

using System;

using System.Collections.Generic;

using System.Text;

using System.ComponentModel;

//Add a reference to the Add-in API (see the solution explorer) and all relevant references

//Use all relevant references

using System.Drawing;

using System.Windows.Forms;

using Microsoft.Dynamics.Framework.UI.Extensibility;

using Microsoft.Dynamics.Framework.UI.Extensibility.WinForms;

//this is to let this add-in speech


using System.Speech;

using System.Speech.Synthesis;

namespace NSpeech


    //Develop the control add-in class.

    //Assign a name to the control add-in (MyCompany.MyProduct.MyAddIn)


    [Description(“Let this Add-in Speak”)]


    //Select a base class as a starting point.

    //Select interfaces to implement features, such as data binding or event handling.

    public class Class1 : StringControlAddInBase


        //Implement control creation

        protected override Control CreateControl()


            //Create a brand new TextBox

            TextBox control = new TextBox();


            //Define TextBox size

            control.MinimumSize = new Size(50, 0);

            control.MaximumSize = new Size(500, Int32.MaxValue);


            //Add a DoubleClick event for the TextBox

            control.DoubleClick += new EventHandler(control_DoubleClick);

            return control;


        //Define a voice synth

        private SpeechSynthesizer synth;

        private void control_DoubleClick(object sender, EventArgs e)


            //create a new speech synth and set default audio device

            synth = new SpeechSynthesizer();



            //Pass TextBox content in a string variable

            string data = this.Control.Text;


            //… and let NAV speak it!





E. Build the NSpeech.dll

  1. Once you have all setup, you are ready to build your Client Add-In. Go to Build > Build NSpeech

F. Place DLL into Add-in folder

  1. Locate/copy/paste NSpeech.dll (should be in your C:\TMP\NSpeech\NSpeech\bin\Debug folder) to the Add-ins folder of a machine where the RoleTailored client has been installed

(typically the Add-ins folder is here: C:\Program Files\Microsoft Dynamics NAV\60\RoleTailored Client\Add-ins)

G. Determine the PKT (Public Key Token) of NSpeech

  1. Launch the Visual Studio Command Prompt
  2. In the VSCP:

Sn –T “C:\TMP\NSpeech\NSpeech\bin\Debug\NSpeech.dll”

In the following example, 250f71f35a467631 is the PKT (Public Key Token) needed to register the Add-in into NAV. (You will have another value.)


H. Register the NSpeech dll

  1. Open Classic Client
  2. Open Object Designer (SHIFT+F12)
  3. Select Table object (ALT+B)
  4. Run Table 2000000069 Client Add-in
  5. Insert a new line with these values:
Field Value
Control Add-in Name Cronus.DynamicsNAV.NSpeech
Public Key Token 250f71f35a467631 (this is an example)
Description Let this Add-in Speak

How to Use This Add-in

As an example, you can just let NAV speak the content of the field “Name” in Customer Card page (Page 21).

  1. Open Classic Client
  2. Go to Object Designer (SHIFT+F12)
  3. Select Page object (ALT+G)
  4. Design Page 21 Customer Card
  5. Go to Name Field and Edit properties (SHIFT+F4)
  6. Fill the ControlAddIn property with this value Cronus.DynamicsNAV.NSpeech;PublicKeyToken=250f71f35a467631 (change the PublickKeyToken value to the one that you have determined at step G.)
  7. Save and compile the page (CTRL+S)

Now…you are ready to let NAV speak the Customer Name from the customer card by simply double clicking on on the Name!

This simple Client Add-in project may be used in, e.g.

  • Speak an alert if the availability of an Item is lower than expected in a document page (e.g. sales quote)
  • Speak an alert if a Customer exceeds assigned Credit Limit
  • Speak internal comments for an item, a vendor, a customer, wherever this is needed
  • … and many more

This simple Client Add-in project may be enlarged, e.g.

  • It could be possible to set the volume of the voice
  • It could be possible to set the rate of the voice
  • It could be possible to select another voice instead of “Microsoft Anne” default in order to speak words with proper accent language
  • It could be possible to save a .wav file instead of speaking it or even perform both activities
  • … and many more

These postings are provided “AS IS” with no warranties and confer no rights. You assume all risk for your use.

Best Regards,

Duilio Tacconi (dtacconi)

Microsoft Dynamics Italy

Microsoft Customer Service and Support (CSS) EMEA

We're always looking for feedback and would like to hear from you. Please head to the Dynamics 365 Community to start a discussion, ask questions, and tell us what you think!