LJtechnical
Technical User
I am trying to make a button open a word doc according to the string contents of the field "Proposal". My attempt to pass the file name is not working and niether is my if string is null loop. Any body got any tips? Code Below
Cheers
___________________________________________________________
Private Sub Command92_Click()
Dim wdApp As Word.Application
Dim strFile As String
Set wdApp = New Word.Application
wdApp.Visible = True
wdApp.WindowState = wdWindowStateMaximize
strFile = Forms![Front End a]!Proposal
If IsNull(strFile) Then
MsgBox "There is no proposal available for this programme currently. Please contact our sales department for more information"
Resume ErrorHandlerExit
End If
wdApp.Documents.Open FileName:="CMQ Database v1.0\Proposals\strFile.doc", ConfirmConversions:= _
False, ReadOnly:=True, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
ErrorHandlerExit:
End Sub
Cheers
___________________________________________________________
Private Sub Command92_Click()
Dim wdApp As Word.Application
Dim strFile As String
Set wdApp = New Word.Application
wdApp.Visible = True
wdApp.WindowState = wdWindowStateMaximize
strFile = Forms![Front End a]!Proposal
If IsNull(strFile) Then
MsgBox "There is no proposal available for this programme currently. Please contact our sales department for more information"
Resume ErrorHandlerExit
End If
wdApp.Documents.Open FileName:="CMQ Database v1.0\Proposals\strFile.doc", ConfirmConversions:= _
False, ReadOnly:=True, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
ErrorHandlerExit:
End Sub