Difference between revisions of "Windows Tips"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Category How to)
m
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{Documentation/Candidate}}
 
== Closing the Windows quickstarter from a macro ==
 
== Closing the Windows quickstarter from a macro ==
  
There seems to be no obvious way to close quickstart.exe (the OOo icon in the system tray) using UNO.  Indeed, "quickstart -killtray" itself does it by searching the running system processes for one with the correct name and path.  The following Basic snippet is a work-round that is OK for some purposes:
+
There seems to be no obvious way to close quickstart.exe (the {{AOo}} icon in the system tray) using UNO.  Indeed, "quickstart -killtray" itself does it by searching the running system processes for one with the correct name and path.  The following Basic snippet is a work-around that is OK for some purposes:
 
+
<syntaxhighlight lang="oobas">
 
   sub KillQuickstarter()
 
   sub KillQuickstarter()
 
       ' Runs "quickstart -killtray"
 
       ' Runs "quickstart -killtray"
Line 9: Line 10:
 
       shell(quickstartPath, 0, "-killtray")
 
       shell(quickstartPath, 0, "-killtray")
 
   end sub
 
   end sub
 +
</syntaxhighlight>
 
[[Category:How to]]
 
[[Category:How to]]

Latest revision as of 13:57, 13 April 2022

Closing the Windows quickstarter from a macro

There seems to be no obvious way to close quickstart.exe (the Apache OpenOffice icon in the system tray) using UNO. Indeed, "quickstart -killtray" itself does it by searching the running system processes for one with the correct name and path. The following Basic snippet is a work-around that is OK for some purposes:

  sub KillQuickstarter()
      ' Runs "quickstart -killtray"
      subst = CreateUnoService("com.sun.star.util.PathSubstitution")
      quickstartPath = subst.substituteVariables("$(prog)/quickstart", 1)
      shell(quickstartPath, 0, "-killtray")
  end sub
Personal tools