473,396 Members | 2,010 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,396 software developers and data experts.

explicitly passing arguments

dorinbogdan
839 Expert 512MB
Hi,

I need to pass some arguments for a method, and ommit several ones, without using null as default.

Expand|Select|Wrap|Line Numbers
  1. var oWord = new ActiveXObject( "Word.Application" );
  2. oWord.visible = false;
  3. oWord.Documents.Add(); 
  4.  
  5. var owRange = oWord.ActiveDocument.Range( 0,0 );
  6. owRange.Text = clipboardTXT;
  7. var owTable = owRange.ConvertToTable( Separator = '\t', , , , , , , , , , , , ,0, 0);
This gives syntax error, because arguments are omitted in ConvertToTable call.

I cannot pass default values, since they are not known at design time.
See more syntax details at ConvertToTable Method.

It seems that passing named arguments using argName:= argValue is not supported in Javascript, like this:
Expand|Select|Wrap|Line Numbers
  1. var owTable = owRange.ConvertToTable( Separator = '\t', AutoFitBehavior:=0, DefaultTableBehavior:=0);
May 2 '07 #1
3 1534
acoder
16,027 Expert Mod 8TB
If you're going to omit anything, that means that you want the default value for that particular argument.

Find all the default values for each argument. Then set each parameter explicitly.

See if that works.
May 2 '07 #2
dorinbogdan
839 Expert 512MB
Thanks acoder,

However there are 3 "default" parameter values calculated for each document at runtime.

For instance:
NumRows/NumColumns - The number of rows/cols in the table. If this argument is omitted, Microsoft Word sets the number of rows/cols, based on the contents of the range or selection.
InitialColumnWidth - The initial width of each column, in points. If this argument is omitted, Word calculates and adjusts the column width so that the table stretches from margin to margin.
May 2 '07 #3
acoder
16,027 Expert Mod 8TB
Is it not possible to just convert to table with no arguments (because they're all optional). Then set the ones that you need separately on the table object.
May 2 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Pavils Jurjans | last post by:
Hallo, I have been programming for restricted environments where Internet Explorer is a standard, so I haven't stumbled upon this problem until now, when I need to write a DOM-compatible code. ...
3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
39
by: Mike MacSween | last post by:
Just spent a happy 10 mins trying to understand a function I wrote sometime ago. Then remembered that arguments are passed by reference, by default. Does the fact that this slowed me down...
5
by: Michael | last post by:
Hi, once I read here that it is not 'a good idea' to pass variables that are not initialized to a function. I have void something ( double *vector ); ....
4
by: Justine | last post by:
Can anyone help? e.g. when you open a vb project property page, in "Configuration Properties" You will see "Command line arguments" in "Start Options". Does anyone knows how to find a way to do...
3
by: KK | last post by:
Hello all, I have several classes binded by one common interface - say 'sum' interface which calculates the sum of all the class elements of type 'int'. class Alphabet { int _a; int _b; int...
2
by: william.w.oneill | last post by:
I have an application that takes a few command line parameters. As recommended by others in this group, I'm using a named mutex to ensure that only one instance of the application is running. My...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.