command line arguments 
Author Message
 command line arguments

Hi,
how can I get the command line argument in a VBA script used when opening a
word document.
Let say I open a document using: winword.exe mydoc.doc param1 param2
Is it possible to retrieve the string "param1 param2" in the Document_Open()
sub?
If it's possible, will I get the parameter even if Word is already opened
when I open my document?

Thank you very much,
David.



Tue, 04 Feb 2003 03:00:00 GMT  
 command line arguments

Hi David,

Well, Word doesn't accept parameters in the command line, so maybe you need to
rethink your approach?

Quote:
> how can I get the command line argument in a VBA script used when opening a
> word document.
> Let say I open a document using: winword.exe mydoc.doc param1 param2
> Is it possible to retrieve the string "param1 param2" in the Document_Open()
> sub?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)



Thu, 06 Feb 2003 03:00:00 GMT  
 command line arguments
I don't have an answer, but I think he's looking for stuff like this:

3       Add a startup switch to the end of the path.

     To start Word and prevent add-ins and global templates (including the Normal
template) from being loaded automatically, type /a

This switch also prevents setting files from being read or modified.

     To start Word and then load a specific Word add-in, type /l addinpath
     To start Word without running any AutoExec macros, type /m
     To start Word and then run a specific macro, type /mmacroname

This switch also prevents Word from running any AutoExec macros.

     To start Word without opening a specific document, type /n
     To start Word and then open a document as a template, type /t followed by a
space and the name of the document.

Quote:

> Hi David,

> Well, Word doesn't accept parameters in the command line, so maybe you need to
> rethink your approach?

> > how can I get the command line argument in a VBA script used when opening a
> > word document.
> > Let say I open a document using: winword.exe mydoc.doc param1 param2
> > Is it possible to retrieve the string "param1 param2" in the Document_Open()
> > sub?

> Cindy Meister
> INTER-Solutions, Switzerland
> http://homepage.swissonline.ch/cindymeister
> http://go.compuserve.com/MSOfficeForum

> This reply is posted in the Newsgroup; please post any follow question or
> reply in the newsgroup and not by e-mail :-)

--

Dave Peterson



Thu, 06 Feb 2003 03:00:00 GMT  
 command line arguments

My problem is :

I have a web application in which i use parameters in the Query string.
Thoes parameters contains values that i need to retreive in a word document
to be able to Select data in my database.

David


Quote:
> I don't have an answer, but I think he's looking for stuff like this:

> 3 Add a startup switch to the end of the path.

> To start Word and prevent add-ins and global templates (including the
Normal
> template) from being loaded automatically, type /a

> This switch also prevents setting files from being read or modified.

> To start Word and then load a specific Word add-in, type /l addinpath
> To start Word without running any AutoExec macros, type /m
> To start Word and then run a specific macro, type /mmacroname

> This switch also prevents Word from running any AutoExec macros.

> To start Word without opening a specific document, type /n
> To start Word and then open a document as a template, type /t followed
by a
> space and the name of the document.


> > Hi David,

> > Well, Word doesn't accept parameters in the command line, so maybe you
need to
> > rethink your approach?

> > > how can I get the command line argument in a VBA script used when
opening a
> > > word document.
> > > Let say I open a document using: winword.exe mydoc.doc param1 param2
> > > Is it possible to retrieve the string "param1 param2" in the
Document_Open()
> > > sub?

> > Cindy Meister
> > INTER-Solutions, Switzerland
> > http://homepage.swissonline.ch/cindymeister
> > http://go.compuserve.com/MSOfficeForum

> > This reply is posted in the Newsgroup; please post any follow question
or
> > reply in the newsgroup and not by e-mail :-)

> --

> Dave Peterson




Fri, 07 Feb 2003 03:00:00 GMT  
 command line arguments

Hi David,

Quote:
> I have a web application in which i use parameters in the Query string.
> Thoes parameters contains values that i need to retreive in a word document
> to be able to Select data in my database.

1) If you use Application.Run to run a Word macro (and assuming this is
Office2000), you can pass parameters this way.

2) You can write the parameters to a Text or INI type file and retrieve them
in Word.

3) You can write them as Doc VARIABLES or CUSTOMDOCUMENTPROPERTIES into the
opened document.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)



Sat, 08 Feb 2003 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Command-Line arguments using Command()

2. "/decompile" command line argument

3. command line arguments for project files

4. Command Line arguments for Project

5. Project_Open and command Line arguments in MSP2k

6. Command Line Arguments

7. command line arguments

8. Command line argument

9. How to get Command Line argument?

10. VB Console App Command Line Arguments

11. Command Line arguments and Scheduling

12. Command Line Argument Parsing

 

 
Powered by phpBB® Forum Software