Hallo Composer,
Samstag, den 09 April 2005 schrieb Composer:
> If I want to add a button to a standard form (ie. Appointment), then
> the event handler for that button must be written in VBS...
>
> VBS code can never call VBA code...
I'am not sure about that, but I don't think so ... I think Sue told me
about an unsopported way to call vba-code from your forms scripting. I
remember something like you have to place your routine at "this outlook
session" and call it inside your forms script like "application.myroutine"
> The many lines of VBA code that I've already implemented for
> interfacing Outlook to another application are going to have to be
> rewritten (or converted) into VBS just for this one button...
>
> Please tell me this isn't true!
you shouldn't do and it isn't necessary, why you think so? I would prefer
to dimension your forms command button "with events" at your existing
vba-code. During open-event you have to refer that button
'***Put that code at the beginning of a class module and
Dim WithEvents mctrlPrintMe As CommandButton
'*** ...somewhere at your forms open event
Set mctrlPrintMe = mctrlControls2("NamePropertyOfYourButton") '
'***...somewhere at your forms close event
Set mctrlPrintMe = Nothing
--
Gruss Michael
|