How to solve number of parameters limitation? More is asked.
carbon
Member Posts: 22
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.
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.
0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions