Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microsoft Word © Automation from Microsoft Access © by Ofer Shimrat for AUGSD MS Office Versions 2000 & 2002.

Similar presentations


Presentation on theme: "Microsoft Word © Automation from Microsoft Access © by Ofer Shimrat for AUGSD MS Office Versions 2000 & 2002."— Presentation transcript:

1 Microsoft Word © Automation from Microsoft Access © by Ofer Shimrat for AUGSD MS Office Versions 2000 & 2002

2 Introduction Automation Creation Manipulation Microsoft Word Microsoft Access Code Summary Conclusion MS Word Automation from MS Access 2 Introduction Microsoft Office Automation Environment Creating MS Word Object in MS Access Manipulating MS Word Object in MS Access Microsoft Word Environment Microsoft Access Environment Code Summary with 2 Examples Conclusion

3 Introduction Automation Creation Manipulation Microsoft Word Microsoft Access Code Summary Conclusion MS Word Automation from MS Access 3 History – DDE (Dynamic Data Exchange) – OLE (Object Linking & Embedding) 1.0 & 2.0 – Active X and COM (Component Object Model) Automation Concepts – Automation Client (i.e. MS Access) – Automation Server (i.e. MS Word) – Automation Type Library – Automation Object Model – Automation Object Types Microsoft Office Automation

4 Introduction Automation Creation Manipulation Microsoft Word Microsoft Access Code Summary Conclusion MS Word Automation from MS Access 4 Automation Creation Declare an object variable New instance started automatically Instance is invisible Can also declare & instantiate manually Dim objWord As Word.Application Set objWord = CreateObject("Word.Application") Or Dim objWord As Word.Application Set objWord = New Word.Application Note: MDB, MDE, Run Time

5 Introduction Automation Creation Manipulation Microsoft Word Microsoft Access Code Summary Conclusion MS Word Automation from MS Access 5 Automation Manipulation Objects have properties Properties can be manipulated objWord.Visible = True objWord.Caption = Text & Field Value objWord.Documents.Add (DocName)

6 Introduction Automation Creation Manipulation Microsoft Word Microsoft Access Code Summary Conclusion MS Word Automation from MS Access 6 Microsoft Word Use existing template (*.dot) Expose VBA in MS Word 40 characters per bookmark – no spaces 16,379 bookmarks per document Properties

7 Introduction Automation Creation Manipulation Microsoft Word Microsoft Access Code Summary Conclusion MS Word Automation from MS Access 7 Microsoft Access Somewhere begin your code with: Dim objWord As Word.Application Set objWord = CreateObject("Word.Application") Somewhere end your code with: objWord.Quit Set objWord = Nothing VBA References

8 Introduction Automation Creation Manipulation Microsoft Word Microsoft Access Code Summary Conclusion MS Word Automation from MS Access 8 Code Summary Code Comments Declare variables Set variables Determine conditions Handle conditions Communicate to User Automate Word Leave user to save/exit Word Return to Access

9 Introduction Automation Creation Manipulation Microsoft Word Microsoft Access Code Summary Conclusion MS Word Automation from MS Access 9 Conclusion Use it when Access reports wont do Programmatically control MS Office Useful in many ad hoc situations Ofer Shimrat (858)


Download ppt "Microsoft Word © Automation from Microsoft Access © by Ofer Shimrat for AUGSD MS Office Versions 2000 & 2002."

Similar presentations


Ads by Google