Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like a method for starting a program when another program starts. Specifically, I’d like a to open a MS Word document and have my citation manager open simultaneously (EndNote supports this function within MS Word preferences, but I recently switched citation managers).

The batch scripts I’ve seen so far, including this one, don’t fit the bill. I’d like to be able to open any existing Word document on my drive and trigger the second program.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

One possible solution:

1) Create a batch file such as C:\ViewDoc.bat:

@echo off
start "Word" "C:\Program Files (x86)\Microsoft Office\Office14\WINWORD.EXE" %1
start "CiteMan" "Drive:\Path\to\Citation Manager.exe"

Edit the paths as required.

2) Right-click any .DOC file, click on Open with, browse and select the batch file:

1

Make sure the Always use the selected program to open this kind of file option is checked.

3) Do the same with any .DOCX file.

Now when you double-click to open any document, the batch file will run instead of Word directly. It in turn will launch Word and open the selected document, as well as launch the other program you want.


An alternate way to do this with any .DOCM macro-enabled document is to add the following code via the Developer tab / Visual Basic editor:

Private Sub Document_Open()
    Shell "Drive:\Path\to\Citation Manager.exe"
End Sub

This will auto-launch the specified program whenever the .DOCM is opened.

share|improve this answer
    
That fits the bill. +1 for adding the .DOCM approach –  metasequoia Nov 19 '12 at 0:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.