Re:
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.