To keep this question simple (or so I thought) the word document would already be open since another script will open the document. The following code seems to work but I'm not sure why "Set oRng = objWord.Sections(1).Range" works with getobject but "Set oRng = objWord.activedocument.content" does not.
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




Reply With Quote
