DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Running an external command from with Microsoft Word?  (Read 11,502 times)

dluby

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 253
Hi all,

Does anyone know how to insert a link to run an external command from within Microsoft Word (2003)?  I'd like to run a command/utility (or whatever) in a similar fashion to the way you can insert Hyperlinks to other documents.

Thanks

Damian

Perry Mowbray

  • N.A.N.Y. Organizer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,817
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
Re: Running an external command from with Microsoft Word?
« Reply #1 on: May 27, 2008, 02:22 PM »
You should just be able to add a hyperlink to a file in the normal manner:

Screenshot - 28_05_2008 , 12_25_45 AM.png
« Last Edit: May 27, 2008, 02:26 PM by Perry Mowbray »

kfitting

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 593
Re: Running an external command from with Microsoft Word?
« Reply #2 on: May 27, 2008, 02:52 PM »
What about commandline arguments?  Like try to open an excel document with some commandline options... I couldnt get that to work.

Kevin

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: Running an external command from with Microsoft Word?
« Reply #3 on: May 27, 2008, 03:06 PM »
Wouldn't something like that be blocked with default security settings?
- carpe noctem

Perry Mowbray

  • N.A.N.Y. Organizer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,817
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
Re: Running an external command from with Microsoft Word?
« Reply #4 on: May 27, 2008, 03:09 PM »
The best I could do was to create a shortcut with the commandline options in the shortcut and add that as the object of the hyperlink.

Messy  :(

Perry Mowbray

  • N.A.N.Y. Organizer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,817
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
Re: Running an external command from with Microsoft Word?
« Reply #5 on: May 27, 2008, 03:10 PM »
Wouldn't something like that be blocked with default security settings?

On my version Word asks me if I'm sure...

dluby

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 253
Re: Running an external command from with Microsoft Word?
« Reply #6 on: May 27, 2008, 03:12 PM »
I managed to get a batch file to work that launched the command with parameters, but Word does warn you about the possibility of the file containing a virus and the command prompt window stays open until I close the utility!

kfitting

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 593
Re: Running an external command from with Microsoft Word?
« Reply #7 on: May 27, 2008, 04:04 PM »
Yeah, we set security to low.  I know it sounds silly and naive but we arent concerned about security in this case... but, it appears that you cant get word to correctly launch hyperlinks with commandline parameters.  We couldnt even get the file to launch if you have the parameters in the link.

Kevin

Original address: https://www.donationcoder.com/forum/index.php?topic=13468.0