Documents.Open method: Problem with optional parameters

code_eater
Member Posts: 5
Hi
I want to open a word document, using .NET variables. Documentation for the command is here:
https://msdn.microsoft.com/de-de/library/microsoft.office.interop.word.documents.open(v=office.11).aspx
As you can see there, the command has a lot of optional parameters. The parameters are all of type "Object".
Has somebody an idea how to use such a function from C/AL without using all parameters or how to use placeholders?
Thx in advance
Thomas
I want to open a word document, using .NET variables. Documentation for the command is here:
https://msdn.microsoft.com/de-de/library/microsoft.office.interop.word.documents.open(v=office.11).aspx
Document Open( [In] ref object FileName, [In, Optional] ref object ConfirmConversions, [In, Optional] ref object ReadOnly, [In, Optional] ref object AddToRecentFiles, [In, Optional] ref object PasswordDocument, [In, Optional] ref object PasswordTemplate, [In, Optional] ref object Revert, [In, Optional] ref object WritePasswordDocument, [In, Optional] ref object WritePasswordTemplate, [In, Optional] ref object Format, [In, Optional] ref object Encoding, [In, Optional] ref object Visible, [In, Optional] ref object OpenAndRepair, [In, Optional] ref object DocumentDirection, [In, Optional] ref object NoEncodingDialog, [In, Optional] ref object XMLTransform );
As you can see there, the command has a lot of optional parameters. The parameters are all of type "Object".
Has somebody an idea how to use such a function from C/AL without using all parameters or how to use placeholders?
Thx in advance
Thomas
0
Comments
-
Old thread but no answer, any idea, anybody? TQ0
-
I did not look any closer at the description of the function, but can you pass null values for those parameters you're not interested in?
See #8 at Vjeko's blog post Top 10 things I miss in .NET Interoperability in NAV 20130 -
Hi vaprog, with variable leaving nothing assigned in or something assigned doesn't make it work.0
-
For any poor souls that find this and were stuck like I was, if you're using Powershell, you can't use $null like you might think. Instead you have to use:
$missing = [System.Reflection.Missing]::Value
And substitute $missing where you would normally put $null.0
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