code_junkie

Trouble accessing MSWord ActiveDocument

Nov 13th, 2011
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. Private Sub Document_Open()
  2.  
  3. If (ActiveDocument.SaveFormat = wdFormatRTF) Then
  4. 'Do some stuff
  5. End If
  6.  
  7. End Sub
  8.  
  9. dim word as new Word.Application
  10. dim doc as Word.Document
  11.  
  12. doc = word.Documents.Open(fileName)
  13. MsgBox doc.FullName
  14.  
  15. If Documents.Count > 0 Then
Add Comment
Please, Sign In to add comment