the.white.hole wrote:Hi Charlie,
However, on the main point, does OO support something similar to a sendkeys function like VBA?
You can use
SendKeys in Calc, or most any other application, using Windows scripting.
Make a script text file, say calcscript.wsf, containing
Code: Select all
<package>
<job id="vbs">
<script language="VBScript">
Dim Args
Dim AppString
Set Args = WScript.Arguments
AppString = Args(0)
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.AppActivate AppString
WshShell.SendKeys "{F2}+{UP}{DEL}~"
</script>
</job>
</package>
Which does edit ({F2}) Shift + Up (+{UP)), delete, then enter, in the active cell.
The AppActivate line wants the Window titlebar info, such as
and that is just
There is much to this scripting business, including several ways to run the files, but I'll use WScript, which accepts command line parameters as WScript.Arguments as in the file above.
So to run it as a Calc macro
Code: Select all
Sub RunWScript
Dim AppString As String
AppString = StarDeskTop.ActiveFrame.Title
shell("WScript ""C:\...path ...\calcscript.wsf""" & " " & AppString,False)
End Sub