Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Nov 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Command line switches (word 2002/sp1)

    I know that from a command line switch you can load a specific template. My question is can you build a command line that loads the template and also imports a text file into that template. I am exporting an file from Autocad and while in Autocad start word using the designate template then import the text file into word.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Command line switches (word 2002/sp1)

    You would have to create a macro that imports the text file, or even creates a new document based on your template and imports the text file into the new document. You can run a specific macro by adding /mmacroname to the command line.

  3. #3
    New Lounger
    Join Date
    Nov 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Command line switches (word 2002/sp1)

    Thanks for the reply. I thought of that but the file name can vary. Is it possible to pass a variable (of the file name) to the macro from a command line.
    I really not that proficient with macros.

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Command line switches (word 2002/sp1)

    You could have a new document based on the template pop up the Insert>File dialog.

    Sub AutoNew
    Dialogs(wdDialogInsertFile).Show
    End Sub

    Rather than insert the file, you could capture the file name and do other things.

    If a command line solution is needed, you could put together a batch or VBScript file that would accept the file name as a parameter, relocate and/or rename it to something that the macro in your template will look for, and then invoke Word.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •