:D need lil assistance

Re: :smiley: need lil assistance

k here it is

I want to view an attched word document. But I keep getting this msg that Type mismatch.file is being attached but i can’t view it for some reason.

To attach file!

Private Sub SelectFile_Click()

Dim OFN As OPENFILENAME
On Error GoTo Err_SelectFile_Click

’ Set options for dialog box.
With OFN
.lpstrTitle = “Select Documents”
If Not IsNull(
[QuoteWorkout]
) Then .lpstrFile =
[QuoteWorkout]

.flags = &H1804 ’ OFN_FileMustExist + OFN_PathMustExist + OFN_HideReadOnly
.lpstrFilter = MakeFilterString(“Word files (.doc)", ".doc”, _
“All files (.)”, “.”)
End With

If OpenDialog(OFN) Then
[QuoteWorkout]
= OFN.lpstrFile
’ [imgPicture].Picture = [PicFile]
’ SysCmd acSysCmdSetStatus, “Afbeelding: '” & [PicFile] & “'.”
End If
Exit Sub

Err_SelectFile_Click:
MsgBox Err.Description, vbExclamation
End Sub

To View File
Private Sub ViewCalc_Click()
On Error GoTo Err_ViewCalc
Dim XL As Object
Set XL = CreateObject(“Word.Application”)

If IsNull(Me.QuoteWorkout) Then
MsgBox “You haven’t Attached a Calculation File”, , “Error”
Else

With XL.Application
.Visible = True
.documents.Open Me.QuoteWorkout

End With

Set XL = Nothing

End If

Exit_ViewCalc_Click:
Exit Sub

Err_ViewCalc:
MsgBox Err.Description
Resume Exit_ViewCalc_Click

End Sub

I hope I am making sense, I just need lil help in correcting the viewing script.