Hello,
I have written the following codes in order to open a word document from an Access 2007 form.
The document was openned correctively but the problem is that I want to be able to go to a specific chapter inside this document based on a search filter field that I will already define in my Access Form.
Then i want to Load this chapter inside my form, manipulate it, then save back in the original Word document.
Can anyone help me finding a solution??
I have written the following codes in order to open a word document from an Access 2007 form.
The document was openned correctively but the problem is that I want to be able to go to a specific chapter inside this document based on a search filter field that I will already define in my Access Form.
Then i want to Load this chapter inside my form, manipulate it, then save back in the original Word document.
Can anyone help me finding a solution??
Code:
Public Sub OpenWordDoc(strDocName As String) Dim objApp As Object 'Opens the document Set objApp = CreateObject("Word.Application") objApp.Visible = True objApp.Documents.Open strDocName End Sub Private Sub cmdOpenWordDoc_Click() 'Check to see that there is a document file path associated with the record If IsNull(FilePath) Or FilePath = "" Then MsgBox "Please Ensure There Is A File Path Associated " & _ "For This Document", _ vbInformation, "Action Cancelled" Exit Sub Else 'Check that the document specified in the file path is actually there If (Dir(FilePath) = "") Then MsgBox "Document Does Not Exist In The Specified Location", _ vbExclamation, "Action Cancelled" Exit Sub Else 'Opens document in Word Call OpenWordDoc(FilePath) End If End If End Sub
Comment