PC Review


Reply
Thread Tools Rate Thread

Calculator on the Tool Bar

 
 
SGangs
Guest
Posts: n/a
 
      12th Jan 2009
How to add Calculator as an icon on the Tool Bar of MS Word 2003 for easy
access.

Thanks in advance..

 
Reply With Quote
 
 
 
 
alborg
Guest
Posts: n/a
 
      12th Jan 2009
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 With Quote
 
Jay Freedman
Guest
Posts: n/a
 
      12th Jan 2009
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Integrated calculator in excel 07 instead of separate calculator =?Utf-8?B?V2F5bmU=?= Microsoft Excel Programming 1 26th Jul 2006 04:16 PM
Calculator Tool =?Utf-8?B?YnJhdHBhazM=?= Windows XP General 6 12th Jan 2006 09:32 PM
Difference Between MS Power Calculator and MS Calculator Plus Sam Windows XP General 5 12th Jul 2005 12:52 AM
uSheet unit conversion/calculator tool beta 1.0 release nospam Freeware 0 15th Jan 2005 03:41 AM
Freeware unit conversion/calculator tool alpha release nospam Freeware 10 12th Jan 2005 05:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:51 PM.