Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: command buttons

17 Jun 2010   #1

windows 7
command buttons

hi everyone,
i'm looking for a little bit of help please, here is what i want to do:
i want a button on a word document that when clicked upon generates a random number between 1 and 6 and displays it. when clicked again, a different number is generated to replace the old one. i'd like the button in the document so that i can take it to different machines. the document in question is an adventure sheet for 'choose your own adventure' style books, and the random number is a dice roll.

i've tried googling and so forth, but unfortunately it appears that i have no knowledge at all in this area and the existing tutorials on command buttons or macros seem difficult to implement. if someone knows how to do this i'd be really grateful for a plain english explanation. i'm fairly quick with concepts and computers, so i'm pretty sure i won;t be asking for a million clarifications !

many thanks,


My System SpecsSystem Spec
18 Jun 2010   #2

Windows 7 Home Premium x64

Welcome to the Seven Forums!

You're going to need to make a macro using Visual Basic for Applications. Don't worry, it's built into Word (assuming you have Word 2000 or newer). Fortunately, I have some experience with Visual Basic (as do some others around here). If you can tell me how you want the button to display the number (in a message box, somewhere on the page, etc), and what the label on the button should be, I should be able to tell you exactly what you need to do.

Also please let me know which version of Word you are using.
My System SpecsSystem Spec

 command buttons

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar help and support threads
Thread Forum
Command Prompt command <ipconfig> not working
when I open up my command prompt and type 'ipconfig' without the ' and press enter it returns the line: 'ipconfig' is nto recognized as an internal or external command, operable program, or batch file I am trying to find out the information I need in order to set up a static IP Address for port...
Network & Sharing
My Windows 7 64bit Home Premium does not have a COMMAND or COM command
When I am told to go to START/SEARCH and type in COMMAND, so I can RUN as Admin, it finds neither COM.exe or COMMAND.exe so I can "Run as Admin" in the DOS windows. It use to. I do have a RUN command that will bring up the DOS window but when executing some commands like CHKDSK it tells me I...
General Discussion
disable "use visual styles on windows and buttons" through a command?
hello, i what to know about a way to disable and enable the "use visual styles on windows and buttons" option by a command.. i want to do that every time i run a game.. it is improvs the performance significantly in games and especially in Emulators.. thanks for helpers!
General Discussion
No REG Command in "Open elevated command window here" DOS Box
I have used the @="cmd.exe /s /k pushd \"%V\"" type of Registry mod to obtain a context menu "Open elevated command window here" menu item, such as in the "Open elevated command window here" thread ( ). ...
General Discussion
Command Buttons In Windows Explorer ?
Hi, Is it possible to get command buttons such as "Copy", "Paste" and "Delete" to be available on the toolbar at the top in Windows Explorer? The only way I can get to these now is from the "Organise" drop down menu or by right clicking a file/folder name. Rgds Auld Bint
Installation & Setup

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 04:46.

Twitter Facebook Google+

Windows 7 Forums

Seven Forums Android App Seven Forums IOS App