Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-10-2015, 05:53 AM
si14 si14 is offline How to run command in word Windows Vista How to run command in word Office 2010 32bit
Novice
How to run command in word
 
Join Date: Jun 2012
Posts: 17
si14 is on a distinguished road
Default How to run command in word

Is it possible to click on a text (e.g. one word) in office word, in such a way that it suns some lines of command prompt script.

To be more specific, I have two lines of code which I need to run in command prompt interface (CMD.EXE in windows).

Instead of doing the following steps, I want to click on a text in microsoft office (e.g. MYFUNCTION) and it runs the following steps:
1- type CMD in command prompt (or open command prompt window)
2- run two codes
3- close command prompt window



Thank you for your help.
Reply With Quote
  #2  
Old 06-10-2015, 05:58 AM
macropod's Avatar
macropod macropod is offline How to run command in word Windows 7 64bit How to run command in word Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,362
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Check out the MACROBUTTON field.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 06-10-2015, 06:06 AM
si14 si14 is offline How to run command in word Windows Vista How to run command in word Office 2010 32bit
Novice
How to run command in word
 
Join Date: Jun 2012
Posts: 17
si14 is on a distinguished road
Default

I was able to create a command and edit it. At the moment, I have the following code:

Sub testp()
'
' testp Macro
'
'
End Sub


What is the command line to open CMD.EXE and then write a code and close the CMD.EXE?

Thank you for your help.
Reply With Quote
  #4  
Old 06-10-2015, 04:08 PM
macropod's Avatar
macropod macropod is offline How to run command in word Windows 7 64bit How to run command in word Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,362
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

What is the aim of the exercise? First you mentioned opening the command window and typing something in, which implies user interaction, but now it seems you simply want to 'write a code', which may not require running CMD.EXE at all.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 2013 ActiveX Command Button Failure irallfml@gmail.com Word VBA 1 05-23-2014 04:19 PM
From the command line, how do I run a Word macro? jdockstader Word 7 02-04-2013 06:09 AM
Edit Points command grayed out in Word 2003 JohnB Word 2 01-27-2012 09:26 AM
How to run command in word Word VBA: How to create a command button and trigger a function? tinfanide Word VBA 2 12-02-2011 05:51 AM
Invoking a command line from inside Word bolpom Word 1 03-16-2011 03:03 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:43 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft