The total automation of MS Office with VB 6.0 SP 6

  • Here is an example that show how we can both automate nearly the whole MS Office-suite and exchange data between the programs.

    Developing plattform:
    Windows 2000 SP-4
    MS Visual Basic Enterprise 6.0 SP-6
    MS Excel 2003
    MS Word 2003
    MS Outlook 2003
    Jet Database
    MDAC 2.5

    How the example work
    First it import data from a Jet Database to an Excel workbook. In the workbook there is two predefined ranges where one is the target-range for the dataimport.

    Then the table is copied to a report in MS Word that is added to an outgoing e-mail in MS Outlook.

    The example can be developed further, like asking the user for some comments on the report and also an error-handling.

    But it is up to You to develop it further.

    Don't forget to set references to all the programs involved as well as ADO.

    The full code:

    As usual comments are most welcome :)

    Enjoy coding!