New Posts  All Forums:Forum Nav:

Help with VB Code - Page 3

post #21 of 23
Thread Starter 
Just to follow up on this, here is my latest script (thanks to Plan9).
Warning: Spoiler! (Click to show)
Code:
<!--
Script Name: Base Paragon Launcher
Version: 0.6
Author: Derek Horn, Client Infrastructure
Creation Date: 10/29/2013
Description: Custom .HTA application to be used as a launcher for Paragon applications.
-->

<SCRIPT LANGUAGE="VBScript">
  Option Explicit

  window.resizeTo 462,400

  Sub logoff
      Dim objShell
      Set objShell = CreateObject("Wscript.Shell")
        objShell.Run "c:\windows\system32\Logoff.exe"
  End Sub
  
  Sub launchExe(exe_name)
      Dim objShell
      Set objShell = CreateObject("Wscript.Shell")
      objShell.Run """C:\Program Files (x86)\Paragon\"+ exe_name + ".exe"""
  End Sub
</SCRIPT>


<HEAD>
  <TITLE>BHN - LAG Paragon</TITLE>
  <HTA:APPLICATION 
      ID="objTest" 
      APPLICATIONNAME="BHN - LAG Paragon"
      INNERBORDER="no"
      SCROLL="no"
      MAXIMIZEBUTTON="no"
      Border = "thin"
      SINGLEINSTANCE="yes"
      SYSMENU="no"
      ICON=".\icons\McK.ico"
  >
</HEAD>

<body bgcolor="#5DB8D7">

<!-- 
Green - 93B622
Red - E73F20
Blue - 5DB8D7
Purple - 62149A 
-->

  <input type="image" img src=".\icons\logoff.png" onclick="logoff">
  <input type="image" img src=".\icons\accounts_payable.png" onclick='launchExe("accounts_payable")'>
  <input type="image" img src=".\icons\application_security.png" onclick='launchExe("application_security")'>
  <input type="image" img src=".\icons\approval_levels.png" onclick='launchExe("approval_levels")'>
  <input type="image" img src=".\icons\clinical_carestation.png" onclick='launchExe("clinical_carestation")'>
  <input type="image" img src=".\icons\downtime_registration.png" onclick='launchExe("downtime_registration")'>
  <input type="image" img src=".\icons\fixed_assets.png" onclick='launchExe("fixed_assets")'>
  <input type="image" img src=".\icons\general_ledger.png" onclick='launchExe("general_ledger")'>
  <input type="image" img src=".\icons\jobstream.png" onclick='launchExe("jobstream")'>
  <input type="image" img src=".\icons\materials_management.png" onclick='launchExe("materials_management")'>
  <input type="image" img src=".\icons\medical_records.png" onclick='launchExe("medical_records")'>
  <input type="image" img src=".\icons\operating_room_management.png" onclick='launchExe("operating_room_management")'>
  <input type="image" img src=".\icons\order_management.png" onclick='launchExe("order_management")'>
  <input type="image" img src=".\icons\paragon_inquiry.png" onclick='launchExe("paragon_inquiry")'>
  <input type="image" img src=".\icons\patient_management.png" onclick='launchExe("patient_management")'>
  <input type="image" img src=".\icons\patient_supply.png" onclick='launchExe("patient_supply")'>
  <input type="image" img src=".\icons\patient_view.png" onclick='launchExe("patient_view")'>
  <input type="image" img src=".\icons\pcon.png" onclick='launchExe("pcon")'>
  <input type="image" img src=".\icons\qem_extract.png" onclick='launchExe("qem_extract")'>
  <input type="image" img src=".\icons\receivables_administrator.png" onclick='launchExe("receivables_administrator")'>
  <input type="image" img src=".\icons\reference_masters.png" onclick='launchExe("reference_masters")'>
  <input type="image" img src=".\icons\registration.png" onclick='launchExe("registration")'>
  <input type="image" img src=".\icons\release_of_information.png" onclick='launchExe("release_of_information")'>
  <input type="image" img src=".\icons\resource_scheduling.png" onclick='launchExe("resource_scheduling")'>
  <input type="image" img src=".\icons\snomed_coding.png" onclick='launchExe("snomed_coding")'>
  <input type="image" img src=".\icons\state_reporting.png" onclick='launchExe("state_reporting")'>
  <input type="image" img src=".\icons\statistical_reports.png" onclick='launchExe("statistical_reports")'>
  <input type="image" img src=".\icons\therapeutic_results_reporting.png" onclick='launchExe("the_rapeutic_results_reporting")'>
  <input type="image" img src=".\icons\utilization_review.png" onclick='launchExe("utilization_review")'>
</BODY>

Seems to do the trick, and is now 81 lines instead of 251. yes, I could shorten it a little more by removing comments and those few color hex codes, but I want to leave those (this script is my base script, where as there will be 4 of these published in XenApp, each with a different background color -- those do not have the commented out color codes).

Thanks again Plan9, it looks much cleaner now and went from 9KB to 4KB.
post #22 of 23
No problem mate. I was tempted to add more logic to merge the logoff and the Paragon routines, but I think that would have resulted in less readable code for the sake of showing off. At least this version is easy to maintain.

Did everything in my code work ok? (I wasn't able to test it myself as I didn't have a spare Windows install at the time)
post #23 of 23
Thread Starter 
Quote:
Originally Posted by Plan9 View Post

No problem mate. I was tempted to add more logic to merge the logoff and the Paragon routines, but I think that would have resulted in less readable code for the sake of showing off. At least this version is easy to maintain.

Did everything in my code work ok? (I wasn't able to test it myself as I didn't have a spare Windows install at the time)

So far it seems that everything is working. We don't have that code in production yet, but it should be going on next week. We do have select physicians using it though, and no complaints!
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming