tailieunhanh - Microsoft WSH and VBScript Programming for the Absolute Beginner Part 12

Microsoft WSH and VBScript Programming for the Absolute Beginner by Jerry Lee Ford Part 12. If you are new to programming with Microsoft WSH and VBScript and are looking for a solid introduction, this is the book for you. Developed by computer science professors, books in the for the absolute beginner series teach the principles of programming through simple game creation. You will acquire the skills that you need for more practical WSH and VBScript programming applications and will learn how these skills can be put to use in real-world scenarios. Best of all, by the time you finish this book,. | Microsoft WSH and VBScript Programming for the Absolute Beginner Second Edition In the Real World Because opening another window while the SendKeys method is executing will divert the keystrokes to the new window you will want to find another way of integrating your scripts with other applications whenever possible. Many applications such as Excel and Word provide their own built-in core object model. WSH scripts can interact directly with these applications by first instantiating references to the application s objects and then accessing their methods and properties. The only trick here is that you need to know the objects that make up the application s object model as well as their associated methods and properties. You can often get this information from the application vendor s Web site or from searching the Internet. Of course if the application that you want to work with does not expose an object model for your scripts to work with you can always try using the SendKeys method. The syntax of the SendKeys method is as follows SendKeysCsiring String is a value representing the keystrokes that are to be sent to the target application. You can send more keystrokes by simply typing them out like this SendKeys I am SendKeys 38 SendKeys years old. However in many cases you ll want to send other types of keystrokes. For example to send an Enter key keystroke you ll need to send the following SendKeys Table provides a list of SendKeys keystrokes that you re likely to want to use. Table SendKeys Keystrokes Key Corresponding SendKeys Codes BACKSPACE BACKSPACE BS or BKSP BREAK BREAK CAPS LOCK CAPSLOCK DEL or DELETE DELETE or DEL DOWN ARROW DOWN Chapter 3 VBScript Basics Table SendKeys Keystrokes continued Key END Corresponding SendKeys Codes END ENTER ENTER or ESC ESC HELP HELP HOME HOME INS or INSERT INSERT or INS LEFT ARROW LEFT NUM LOCK NUMLOCK PAGE DOWN PGDN PAGE UP PGUP PRINT SCREEN PRTSC RIGHT ARROW RIGHT SCROLL LOCK SCROLLLOCK TAB tab UP ARROW UP Fl