Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
SGangs SGangs is offline
external usenet poster
 
Posts: 1
Default Calculator on the Tool Bar

How to add Calculator as an icon on the Tool Bar of MS Word 2003 for easy
access.

Thanks in advance..

  #2   Report Post  
Posted to microsoft.public.word.docmanagement
alborg alborg is offline
external usenet poster
 
Posts: 67
Default Calculator on the Tool Bar

Hi S:

Just place a module with a macro such as this-

Private Sub CommandButton2_Click()
Dim WshShell As Object
Set WshShell = CreateObject("Wscript.Shell")
WshShell.Run "Calc"
Set WshShell = Nothing
End Sub

You can also do other API callups, s.a.-

-- WshShell.Run "NotePad" (or "NotePad C:\MyTrains.txt" to bring up a file)
-- WshShell.Run "Explorer"

Cheers,
Al

"SGangs" wrote:

How to add Calculator as an icon on the Tool Bar of MS Word 2003 for easy
access.

Thanks in advance..

  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Calculator on the Tool Bar

VBA also has a Shell method that can launch executables without the
Wscript.Shell. It does require the full path to the executable file, though.
For the calculator, the macro would be

Sub RunCalc()
Shell "c:\windows\system32\calc.exe", vbNormalFocus
End Sub

Also note that if you want to put a button on a toolbar (rather than on a
userform), the first line should start with Sub (or Public Sub, but Public
is the default and can be left out) and not with Private. Procedures that
are marked Private won't appear in the list of macros in the Customize
dialog, which makes it hard to assign them to toolbar buttons.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

alborg wrote:
Hi S:

Just place a module with a macro such as this-

Private Sub CommandButton2_Click()
Dim WshShell As Object
Set WshShell = CreateObject("Wscript.Shell")
WshShell.Run "Calc"
Set WshShell = Nothing
End Sub

You can also do other API callups, s.a.-

-- WshShell.Run "NotePad" (or "NotePad C:\MyTrains.txt" to bring up
a file)
-- WshShell.Run "Explorer"

Cheers,
Al

"SGangs" wrote:

How to add Calculator as an icon on the Tool Bar of MS Word 2003 for
easy access.

Thanks in advance..



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
XP 2003 Calculator Button Geoff[_2_] New Users 2 October 13th 08 08:13 AM
Getting Calculator to stay on top of Window pane Lynn Craven Microsoft Word Help 5 August 7th 08 06:46 AM
Calculator use Lara Microsoft Word Help 1 October 18th 07 12:29 AM
how do i do taesting for my course calculator? kammie Microsoft Word Help 1 March 15th 05 02:21 PM
How can I put a calculator icon on my toolbar? Traduc Microsoft Word Help 3 January 5th 05 09:29 PM


All times are GMT +1. The time now is 08:26 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"