Hello Guest it is April 19, 2024, 10:37:59 AM

Author Topic: Silly but handy button scripts. Help Calc Wiki  (Read 3333 times)

0 Members and 1 Guest are viewing this topic.

Silly but handy button scripts. Help Calc Wiki
« on: December 21, 2008, 09:09:33 PM »
Hi,
Get tired of leaving Masch to fire up the winfows calc?
Place this under a button.

Shell(calc.exe)

I also wanted a button to open the PDF, without having to know the path to Acrobat. So I did this:


Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA"(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String,ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

ExecuteLink("Mach3Mill_1.84.pdf")

Public Sub ExecuteLink(Link As String)
   On Error Resume Next
   Dim lRet As Long
   If Link <> "" Then
       lRet = ShellExecute(0, "open", Link, "", CurDir())
       If lRet >= 0 And lRet <= 32 Then
           MsgBox "Error jumping to:" & Link, 48, "Warning"
       End If
   End If
End Sub





I also wanted to be able to bring up the Wiki. Use the previous scipt but replace the
line ExecuteLink("Mach3Mill_1.84.pdf")
with  ExecuteLink("http://www.machsupport.com/MachCustomizeWiki/index.php?title=Main_Page")

I take no responsibility for how stable this is because I not used it much so far, but it seems fine.

Landrum

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Silly but handy button scripts. Help Calc Wiki
« Reply #1 on: December 21, 2008, 10:18:53 PM »
Thanks for shareing Landrum.  :)

Time savers are great.

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!