NAV2013 automation - setfilter

Capone
Member Posts: 125
Hi,
I'm testing to migrate a piece of code to NAV 2013
When I run this I get something like this (translated) "The type Record2000000046() is aged"
When I debug it sticks on Automation.setfilter. So why does it complain on this when the datatype allows this in the symbol menu? :-k
I'm testing to migrate a piece of code to NAV 2013
Office_Version := 0; Automation_Server.SETFILTER(Name,'Microsoft Excel 8.0 Object Library'); IF Automation_Server.FINDFIRST THEN Office_Version := 1; Automation_Server.SETFILTER(Name,'Microsoft Excel 9.0 Object Library'); IF Automation_Server.FINDFIRST THEN Office_Version := 2; Automation_Server.SETFILTER(Name,'Microsoft Excel 10.0 Object Library'); IF Automation_Server.FINDFIRST THEN Office_Version :=3; Automation_Server.SETFILTER(Name,'Microsoft Excel 11.0 Object Library'); IF Automation_Server.FINDFIRST THEN Office_Version := 4; Automation_Server.SETFILTER(Name,'Microsoft Excel 12.0 Object Library'); IF Automation_Server.FINDFIRST THEN Office_Version := 5; Automation_Server.SETFILTER(Name,'Microsoft Excel 14.0 Object Library'); IF Automation_Server.FINDFIRST THEN Office_Version := 6;
When I run this I get something like this (translated) "The type Record2000000046() is aged"
When I debug it sticks on Automation.setfilter. So why does it complain on this when the datatype allows this in the symbol menu? :-k
Hello IT, have you tried to turn it off and on?
Have you checked the cables?
Have you released the filters?
http://www.navfreak.com
Have you checked the cables?
Have you released the filters?
http://www.navfreak.com
0
Answers
-
There is two DotNet datatypes you can use.
Declare 2 variablesWordHelper - DotNet - Microsoft.Dynamics.Nav.Integration.Office.Word.WordHelper. 'Microsoft.Dynamics.Nav.Integration.Office, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
WordApplication - DotNet - Microsoft.Office.Interop.Word.ApplicationClass. 'Microsoft.Office.Interop.Word, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
Then the code:WordApplication := WordApplication.ApplicationClass; MESSAGE('%1',WordApplication.Version)
Will show the office version, in my environment 14.0 (office 2010)
Check in codeunit 5054 WordManagement for other stuffs about office integration.0 -
Great, it worked.
Cheers!Hello IT, have you tried to turn it off and on?
Have you checked the cables?
Have you released the filters?
http://www.navfreak.com0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions