We use a small database for tracking all our word documents. The following code opens up the appropriate document in word, but currently opens .doc. I want it to open .doc or .docx, obviously we have both versions now we have upgraded word.
Private Sub Form_Click()
Dim WDAPP As Object
Set WDAPP = CreateObject("Word.Application")
If Me!Programme = "Word" Then
WDAPP.Documents.Open "y:\windata\" & Forms!frmresults!DocNo & ".doc"
WDAPP.Visible = True
MsgBox ("This is not a Word Document")