Automation 2000
Total Page:16
File Type:pdf, Size:1020Kb
Automation 2000 Your Guide to iroot ie teroeriit Recommended Reading Microsoft Office 2000/Visual Basic : Programmer's Guide (Microsoft Professional Editions) by David Shank, Mark Roberts, Tamra Myers With detailed technical information delivered straight from the Microsoft Office 2000 documentation team, this practical and precise guide offers hands-on detail for everything from planning and developing Office 2000 solutions, working with data, designing multiuser solutions, and distribution. Paperback - 800 pages (May 1999) Microsoft Press; ISBN:1572319526 Microsoft Office 2000 Automation Contents What is Automation? ...................................................................................................................... 4 An Example of Using an Application Recorder ............................................................................. 5 How to Reference an Automation Object....................................................................................... 7 The CreateObject Function......................................................................................................... 7 The GetObject Function.............................................................................................................. 7 The New Keyword...................................................................................................................... 7 Using References ........................................................................................................................ 7 Early Binding.............................................................................................................................. 9 Benefits of Early Binding ........................................................................................................... 9 Late Binding.............................................................................................................................. 10 Using Object Libraries and the Object Browser....................................................................... 10 OLE Programmatic Identifiers.................................................................................................. 12 Destroying Automation Sessions.............................................................................................. 15 Troubleshooting Error 429 When Automating Office Applications ........................................ 16 ACCESS: The Microsoft Office Database Management System................................................ 17 Detect if Access is Installed...................................................................................................... 18 Creating an Instance of Microsoft Access ................................................................................ 18 Referencing a New Instance of Microsoft Access.................................................................... 19 Referencing an Existing Instance of Microsoft Access ............................................................ 19 Terminating an Instance of Microsoft Access .......................................................................... 20 NewCurrentDatabase Method Example ................................................................................... 20 Output an Access Report .......................................................................................................... 21 Opening a Secured Database through Automation................................................................... 22 Import a Text File into Access.................................................................................................. 23 Sending the Current Record to Word........................................................................................ 24 Using Automation with the Run-Time Version of Microsoft Access ...................................... 26 User Control and Visible Hints................................................................................................. 27 Using API calls to Bring Microsoft Access into View............................................................. 27 Microsoft Binder........................................................................................................................... 30 Adding Documents to the Binder ............................................................................................. 30 Delete Sections From a Binder ................................................................................................. 31 EXCEL: The Microsoft Office Spreadsheet................................................................................ 32 Microsoft Excel......................................................................................................................... 32 Differences From Earlier Versions of Microsoft Excel............................................................ 33 Determining if You Should Close the Instance of Microsoft Excel ......................................... 34 Destroying an Instance of Microsoft Excel .............................................................................. 35 Using a Pre-Existing Instance of Microsoft Excel.................................................................... 36 Making an Instance of Microsoft Excel Visible ....................................................................... 37 Opening a Microsoft Excel Workbook..................................................................................... 38 Adding a New Worksheet to an Existing Microsoft Excel Workbook..................................... 39 Using the Range Object With Microsoft Excel ........................................................................ 39 Page 2 Microsoft Office 2000 Automation Adding a Named Range to a Workbook................................................................................... 40 Selecting a Specific Location on a Microsoft Excel Worksheet............................................... 41 Editing a Microsoft Excel Workbook....................................................................................... 42 Populating a List Box with Data From Excel. .......................................................................... 43 Opening a CSV file with Microsoft Excel - from Microsoft Access........................................ 44 Copy Formulas.......................................................................................................................... 46 Use Automation to Transfer an Array of Data to a Range on a Worksheet: ............................ 46 Use Automation to Transfer an ADO Recordset to a Worksheet Range.................................. 47 GRAPH......................................................................................................................................... 49 Changing a Graph's Data Marker's Shape................................................................................. 49 Changing a Microsoft Graph Chart Type ................................................................................. 49 Changing the Border Properties of a Graph.............................................................................. 49 Changing the Line Texture on a Graph..................................................................................... 50 Changing the Range of an Axis ................................................................................................ 50 Manipulating a Graph's Legend................................................................................................ 51 OUTLOOK: The Microsoft Office E-mail and Personal Information Manager ......................... 52 Printing Messages From Outlook. ............................................................................................ 52 Creating a New Folder in Microsoft Outlook........................................................................... 53 Sending an Outlook Message With an Attachment. ................................................................. 54 Adding Notes to Microsoft Outlook ......................................................................................... 55 Adding Tasks to Microsoft Outlook ......................................................................................... 56 Starting a Session of Microsoft Outlook With a Different Profile ........................................... 56 Import Outlook Items from an Access Database ...................................................................... 57 POWERPOINT: The Microsoft Office Presentation Graphics Program .................................... 59 Run a Microsoft PowerPoint Presentation................................................................................ 59 Creating a PowerPoint Slide Containing a Graphic.................................................................. 60 PROJECT: Build a Project Plan .................................................................................................. 61 Build a Project File from a Database ........................................................................................ 61 WORD: The Microsoft Office Word Processor .......................................................................... 63 Automate Word with the New Keyword .................................................................................. 63 Create a Word Document.......................................................................................................... 64 Closing the Microsoft Word Document...................................................................................