Darren,

It looks like there is an extra space in this -

$=sendkeys ("~ D")

It should be -

$=sendkeys("~D")

Borrowing from the manual (Pg. 91 version 4.21 Manual) -
quote:

To specify that any combination of SHIFT, CTRL, and ALT should be held down while several other keys are pressed, enclose the code for those keys in parentheses. For example, to specify to hold down SHIFT while E and C are pressed, use "+(EC)". To specify to hold down SHIFT while E is pressed, followed by C without SHIFT, use "+EC".

HTH,

Kent

[ 21. July 2003, 11:25: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's