Results 1 to 20 of 23

Thread: Referencing a Word document that is already open

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    VBAX Contributor
    Joined
    Jun 2014
    Posts
    107
    Location
    Thank you for the replay. So you kind of gave me a solution. I tried what you suggested but I got the file already open problem. If I use part of the original code but use your option for the range it works. Any idea why? (I'm trying to do this from within Access)

    Private Sub Command0_Click()
    Dim objWord As Object
    Dim oRng As Word.Range
     
    Set objWord = GetObject(, "Word.Application")
    Set objWord = GetObject("C:/temp/test1.docm")
     
    Set oRng = objWord.Sections(1).Range
    Debug.Print oRng.Text
    End Sub
    Last edited by heedaf; 08-16-2017 at 11:11 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •