This project has moved and is read-only. For the latest updates, please go here.

Will Netoffice support optional parameter and named arguments in C#?

Jun 4, 2011 at 12:53 AM

Can the following statement simplified?

newDocument.SaveAs(documentFile, Missing.Value, Missing.Value, Missing.Value,  Missing.Value, Missing.Value,
                                            Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);

Like this:

newDocument.SaveAs(documentFile);

 

Jun 4, 2011 at 11:25 AM

hello,

in first release netoffice supports optionals in .net 4 but Visual Basic can't handle this.
see also this discussion http://netoffice.codeplex.com/discussions/259502

what i can do is to create some overloads for the typical open and save methods in in office.
comes with release 0.9 this weekend or release 1.0 (release date: 15.06.2011)

Sebastian

May 13, 2015 at 9:48 AM
Hi,

Is optional named arguments considered to be not supported?

I do not see how overloads support my needs.

E.g. WordApi MailMerge.OpenDataSource 15 arguments, I need to set first 2 and 10,11 . What are defaults for all values between arguments important for me?

Why I have to type same many times?

C#/VB.NET/F# all have optional named arguments.
May 26, 2015 at 3:44 PM
hello,

im understand how important it is to support optional arguments.
for this reason NetOffice 1.6 want give so called "extension assemblies" too.
its a set of linq extension methods with optional argument support.
its the best solution to keep supporting older framework versions and spend optionals in .net 3.5 and higher what i think.

the extension assemblies[beta] are in currently in use by some high-priority support contractors. no problems so far, i hope i can publish them
very soon.

*Sebastian