|
|
 |
| Word VBA Discuss using VBA to program Word. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Word VBA section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

September 18th, 2009, 05:48 PM
|
|
Registered User
|
|
Join Date: Sep 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Auto run batch file attached to word-Documents/VBA code is required
Hello every body!
Does any body know how can I make a batch file .bat or exe run automatically and synchronously when I open a word document through VBA code?
Note: this batch file is previously attached to the document. So I need a code to call this batch.
Hoping to see your answer ASAP
Thanks/regards,
|

September 20th, 2009, 08:17 AM
|
|
Friend of Wrox
|
|
Join Date: Sep 2005
Location: , , .
Posts: 420
Thanks: 0
Thanked 14 Times in 14 Posts
|
|
If you want to run a batch file when the document is opened, you can add a shell command in the Document_Open event of the particular document.
Shell("c:\temp.exe")
Cheers
Shasur
|

September 20th, 2009, 08:35 AM
|
|
Registered User
|
|
Join Date: Sep 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks but it does not work
hello Shasur
Thanks for your reply. I tried this, but it does not work. An error message
appears:
Run time error "53"
File not found.
please note that I attached the batch to the document as an object. It is not existed in C drive , but in the document itself.
I am looking forward for your response.
Thanks/ take care
|

September 23rd, 2009, 07:08 PM
|
|
Registered User
|
|
Join Date: Sep 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Where are your comments!!!!!!!!!!
hellllllllloooooooo
I am still waiting . who knows how the code should be, please answer as quick
as possible. Actually I need this for good and defense intention. Someone
attacked and annoyed me with his wicked e-mails. I am planning to delete my
e-mail address from his computer through the batch file.
I have the batch, but I need to convince him to open it. so I decided to attach
it to word file. In this way the batch file runs as he opens the word file.
Please respond, I promise I would not hurt any one through this code.
I am looking forward to receive your solution very soon.
Thanks/regards,
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |