Rick, when working with Objects you need to use “set” with the assignment operation.
set myWindow = FocusedWindow Otherwise VB will think the variable is a scaler. This is another advantage of Chips environment. dim myWindow as WindowEyes.Window : myWindow = ClientInformation.OverlapWindow I am fairly sure this will immediately give you an error, but if not then doing a debug->compile will recognize that you are not using the set when assigning to an object variable. > On Mar 21, 2015, at 12:50, Rick Thomas via Scripting > <[email protected]> wrote: > > First, how do I copy and paste error compile or run time error messages for > posting to the list? > > Below is the script, only a few lines, with my question > > Note that in the original script I did not see where windowObj was set to > anything - could have been the problem so testing this: > > ' VS2013 > > Option Explicit > > Dim myMSAAEventSource : Set myMSAAEventSource = MSAAEventSource > > myMSAAEventSource.Process = ClientInformation.ApplicationProcess > > [The below statement threw an error message, how would I do this?] > > ' Dim windowObj: windowObj = ClientInformation.Overlap > > ConnectEvent ClientInformation.Overlap, "OnChildFocus", "OnChildFocus" > > Sub OnChildFocus( windowObj ) > > Logger( "OnChildFocus fired") > > End Sub > > ' EndOfFile: > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > <http://lists.window-eyes.com/private.cgi/scripting-window-eyes.com/attachments/20150321/8875e9ba/attachment.htm> > _______________________________________________ > Any views or opinions presented in this email are solely those of the author > and do not necessarily represent those of Ai Squared. > > For membership options, visit > http://lists.window-eyes.com/options.cgi/scripting-window-eyes.com/jon.c.cohn%40gmail.com. > For subscription options, visit > http://lists.window-eyes.com/listinfo.cgi/scripting-window-eyes.com > List archives can be found at > http://lists.window-eyes.com/private.cgi/scripting-window-eyes.com Best wishes, Jonathan _______________________________________________ Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Ai Squared. For membership options, visit http://lists.window-eyes.com/options.cgi/scripting-window-eyes.com/archive%40mail-archive.com. For subscription options, visit http://lists.window-eyes.com/listinfo.cgi/scripting-window-eyes.com List archives can be found at http://lists.window-eyes.com/private.cgi/scripting-window-eyes.com
