473,394 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Can someone tell me what the parameters are?

I was just looking that the Word Document Model and at code for creating a
Word Document. The C# code appears to have several more parameters for
creating a Word Document than does Visual Basic. I am curious why...
As you can see from the code below they list 3 ref variables after the
template. What can you do with those variables?

Visual Basic
ThisApplication.Documents.Add(Template:="C:\Test\M yTemplate.Dot")

// C#
object missingValue = Type.Missing;
object template = "c:\\temp\\MyTemplate.dot";
ThisApplication.Documents.Add(ref template, ref missingValue, ref
missingValue, ref missingValue);

--
Henry Stock, Network Administrator
onProject.com
3 Wing Drive
Cedar Knolls, NJ 07927-1006
Nov 15 '05 #1
1 1238
Henry,

The reason for this is because C# doesn't support optional parameters,
which COM does. Because of this, you are forced to pass in values for every
parameter, the missing ones being Type.Missing.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Henry Stock" <hs****@onproject.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I was just looking that the Word Document Model and at code for creating a
Word Document. The C# code appears to have several more parameters for
creating a Word Document than does Visual Basic. I am curious why...
As you can see from the code below they list 3 ref variables after the
template. What can you do with those variables?

Visual Basic
ThisApplication.Documents.Add(Template:="C:\Test\M yTemplate.Dot")

// C#
object missingValue = Type.Missing;
object template = "c:\\temp\\MyTemplate.dot";
ThisApplication.Documents.Add(ref template, ref missingValue, ref
missingValue, ref missingValue);

--
Henry Stock, Network Administrator
onProject.com
3 Wing Drive
Cedar Knolls, NJ 07927-1006

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

114
by: muldoon | last post by:
Americans consider having a "British accent" a sign of sophistication and high intelligence. Many companies hire salespersons from Britain to represent their products,etc. Question: When the...
2
by: marco | last post by:
the problem: I use a typedef inside a class template, than I use this type (dim_v<N1>::Type) to define the argument of a template function f but when I call this function from main, the compiler...
21
by: MLH | last post by:
A97 procedure to open http://www.arch.com/message/ enter an 800 number, press "Continue", enter a text msg string from a memo field and press "Send" This is a calendaring and appointment A97...
5
by: IGotYourDotNet | last post by:
How can i get this work going against an Oracle Table? I have it working with SQL, but when I change my db to Oracle I get an error. The where clause is based on what is selected in the drop down...
2
by: Extremest | last post by:
Here is the code I have so far. It connects to a db and grabs headers. It then sorts them into groups and then puts all the complete ones into another table. Problem I am having is that for some...
6
by: Dildo Boy | last post by:
I am trying to write a program which asks the user to enter a number in the interval , the program then gives the natural logarithm of that number, using the series for log(x+1)... Here is what...
2
by: jbonifacejr | last post by:
Sorry if this angers anyone. I'm posting here and to the .NET group. I am unable to get a return value from a stored procedure in .NET using the following Sproc and .NET code Here is the code...
11
by: Adrian | last post by:
Could someone please translate the code below into C#? Please also tell me the libraries I might need. Many thanks, Adrian. int main() { (GetProcAddress( LoadLibrary( "krnl386.exe" ),...
9
by: bill | last post by:
Dim Con = New OleDb.OleDbConnection("provider=microsoft.jet.oledb.4.0;" & "data source=c:\_Archive\Documentation - Projects\Hardware Tracking - 2008\IT_Assets.mdb") Dim dataAdapter As...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.