Results 1 to 4 of 4
  1. #1
    walid geagea is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    2

    Search a Word Document's contents from Access 2007 interface


    Dear,

    Can anyone of you help me finding a solution for the below:


    - I have created a form that contains a field labeled fldCode.
    -fldCode is a drop down list that contains a list of all Chapters in a specific Word Document.
    - I have a button that opens the word document in a shared path.
    I want to create a search button or function, that goes to the word document and search for the chapter's number based on the value that was already checked in the fldCode and import the chapter or the document to to Access if possible, so the user will modify the document in Access then save it back to Word Document
    Any similar application or code is appreciated.
    I will work on doing the modification.


    Thank you in advance

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    have you tried anything yet?

  3. #3
    walid geagea is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    2
    This is all what I have done.
    I just don't know from where to start to make the word document searh filter based on the form drop down list value named fldcode



    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


    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

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    what I can think of here is actually USING word to get code. you tried the macro recorder in there?? as far as finding a block of text in a doc, brining it into access to be modified, and then throwing it back into the doc where it belongs.....ummmm that seems a little bit redundant dont ya think?? Honestly, if I were in your shoes, I would tell whoever supposedly needs this to happen, that it's a waste of time in terms of effort and complexity both to obtain this "little" convenience.

    why can't they just modify the doc after it's opened?? I guess I don't understand that one. care to offer insight??

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Closing Word Document From Access
    By bburton in forum Programming
    Replies: 2
    Last Post: 04-25-2011, 10:23 AM
  2. Cannot sort on column contents (Access 2007)
    By jameshurrell in forum Access
    Replies: 6
    Last Post: 03-15-2011, 10:57 AM
  3. Replies: 5
    Last Post: 10-19-2010, 08:02 AM
  4. Open a word document from access
    By natalia in forum Programming
    Replies: 1
    Last Post: 10-13-2010, 08:04 AM
  5. Word document INTO Access form
    By jonathonhicks in forum Forms
    Replies: 0
    Last Post: 04-30-2007, 05:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums