Answered Type Text in Word from Access VBA

  • Wednesday, October 28, 2009 5:17 PM
     
     

    Hi

    I'm a novice in using Access VBA to do things in Word and would like some code that will type into word. I have the following as a starting point and although it runs through without error, I cannot see the text in the resulting Word doc. What am I doing wrong? Thanks in advance.

    Dim MyWord As Word.Application, MyDoc As Word.Document, MySelection As Selection

    Set MyWord = New Word.Application
    Set MyDoc = MyWord.Documents.Add
    Set MySelection = Word.Selection

    MyWord.Visible = True

    MySelection.TypeText ("Project Status Report")
    MySelection.TypeParagraph

    End Sub

    • Moved by Jeff Shan Friday, October 30, 2009 1:19 AM vba question (From:Visual Basic General)
    •  

All Replies