Skip to content
Microsoft Dynamics 365 Blog

In this blog is described a very simple usage of the .NET interoperability feature with Microsoft Dynamics NAV 2009 R2 and can be considered an extension of my previous blog:

It is intended just to familiarize you with this brand new feature proposed with the NAV 2009 R2 release.

If you want to know more about .NET interoperability for NAV 2009 R2, please refer to MSDN link:

Extending Microsoft Dynamics NAV Using Microsoft .NET Framework Interoperability

The .NET interoperability code snippet in this blog is based on the System.Speech namespace.

My ingredients:

  • NAV 2009 R2
  • Windows 7 Enterprise

Create your “Speak it!” action and let NAV speak Customer Names :

1. Open Classic Client

2. Go to the Object Designer

3. Select Page object (alt+g)

4. Select Page 22 “Customer List”

5. Design Page 22 “Customer List” (alt+d)

6. Select View > Page Actions (al+v, o)

7. Create a new Action (F3) in the ActionItems container (see below)

8. Change the properties of the Action as below:

Caption – Speak it !

Image – ViewComments

Promoted – Yes

PromotedCategory – Process

PromotedIsBig – Yes

9. Edit the code in the Speak it! Action (F9)

10. Add those LOCAL variables


DataType: DotNet

Subtype: System.Speech, Version=, Culture=neutral,PublicKeyToken=31bf3856ad364e35.System.Speech.Synthesis.SpeechSynthesizer


DataType: DotNet

Subtype: System.Speech, Version=, Culture=neutral,PublicKeyToken=31bf3856ad364e35.System.Speech.Synthesis.SpeechSynthesizer



DataType: DotNet

Subtype: System.Speech, Version=, Culture=neutral,PublicKeyToken=31bf3856ad364e35.System.Speech.Synthesis.VoiceGender



DataType: Integer


NOTE: RUNONCLIENT is a property of each DotNet variable (shift+f4)

11. Add this code snippet in the OnAction trigger

// Copyright © Microsoft Corporation. All Rights Reserved.

// This code released under the terms of the

// Microsoft Public License (MS-PL,

// Use the constructor to create a new Synthesizer

Synth := dnSpeech.SpeechSynthesizer();


// This is an enumeration assignment:

// 0=NotSet,1=Male,2=Female,3=Netural

dnVoiceGender := 2; //Female

// NOTE: it will take the voice depending on what is

//  installed locally (e.g. Windows 7 has Microsoft Anne voice)


// Please, speak slowly (range [-10:10])

Synth.Rate := -3;



// Row below is not needed. Synth is a local variable therefore it will be

// automatically disposed

// Synth.Dispose;

12. Save and compile (ctrl+s) page 22 “Customer List”

Now… you are ready to let NAV speech the Customer Name from the customer list by simply click on the “Speak it!” action.

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!