How to solve number of parameters limitation? More is asked.

carboncarbon Member Posts: 22
edited 2014-04-03 in NAV Three Tier
Hi developers,
I need to move a functionality from NAV2009 to NAV2013. It means I have to use DOTNET variables instead of Automation. The goal is to use MS Word template and run a macro saved in this template.
1. I think I use right DOTNET variable. Do you agree? I make something like below.
2. But there is one stressful issue. It is possible to pass only apx. 15 parameters (NAV limitation) when wdApp.Run method is called. Indeed in NAV2013 wdApp.Run method requires 31 parameters. How can I pass required numbers of parameters (31) if number exceeds NAV limitation (apx. 15)? Is there some workaround solution?
Thank you for any hint.

NAV 2009
Definition variable: wdApp as Automation: {00020905-0000-0000-C000-000000000046} 8.1
Using of variable wdApp (this works fine):
//Run a macro from MS Word template:
wdApp.Run(sMacroname,"Bill-to Name","Bill-to Name 2","Bill-to Address","Bill-to Address 2","Bill-to Post Code","Bill-to City","Bill-to Contact",sCountry);

NAV 2013
Definition variable: wdApp as Microsoft.Office.Interop.Word.ApplicationClass.'Microsoft.Office.Interop.Word, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' (see http://msdn.microsoft.com/en-us/library/Microsoft.Office.Interop.Word%28v=office.15%29.aspx)
Using of variable wdApp (compilation is not possible):
//Run a macro from MS Word template:
//see http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.applicationclass.run%28v=office.15%29.aspx
wdApp.Run(sMacroname,"Bill-to Name","Bill-to Name 2","Bill-to Address","Bill-to Address 2","Bill-to Post Code","Bill-to City","Bill-to Contact",sCountry)
Compilation error:
When the function is called, the minimum number of parameters should be used. For example: MyFunc( .. , .. , .. ).
or
wdApp.Run(sMacroname3,"Bill-to Name","Bill-to Name 2","Bill-to Address","Bill-to Address 2","Bill-to Post Code","Bill-to City","Bill-to Contact",sCountry,Fool,Fool)
Compilation error:
Reduce the expression so it is less complex.
Sign In or Register to comment.