I have a Word doc in a RTF. How do I open the doc.
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim template As Variant
Dim ws As New NotesUIWorkspace
Set db = Session.CurrentDatabase
Set view = db.GetView("Attachment")
Set doc = view.GetFirstDocument
If doc Is Nothing Then
Exit Sub
Else
Set rtitem = doc.GetFirstItem( "Attachment" )
If ( rtitem.Type = RICHTEXT ) Then
Msgbox "Found"
Set template = rtitem.GetEmbeddedObject("Microsoft Word Document")
'Set handle = template.Activate( False )
End If
If Isempty(template) Then
Messagebox "No import file specified", MB_OK+MB_ICONSTOP, "Error"
Exit Sub
End If
Dim Word As Variant
Set Word = CreateObject("Word.Application") 'Create Word Object
Word.Visible = True
'Word.Documents.Open importFilePath$ ' Open the Word file
Word.Documents.Open template ' Open the Word file
End If
End Sub
I get an ‘Automation object argument type mismatch’
Word opens but the document doesn’t.
Does anyone know why and if so how do I fix it?
Thanks