hi,
I am having a problem while providing more control while opening word..Below is the code where i am able to open the file. in this code when somebody clicks on command2 button a input box opens and it asks for CRC ID & then it opens the required docuemnt from the path as below.
But i want
1)if any CRCID is not found in the path, one msgbox will appear.
2) When somebody clicks on cancel button of input box. It should go to form only.
Kindly help me out with this problem. Thanx in Advance
Private Sub Command2_Click()
Dim intCRID, i As Integer
Dim StrFile As String
Dim appword As New Word.Application
intCRID = InputBox("CRC ID:", "OPEN CRC ANALYSIS DOCUMENT", "")
appword.Visible = True
appword.Documents.Open ("D:\projects\CRC MANAGEMENT\vb\" & intCRID & " .doc")
End Sub