Results 1 to 12 of 12
  1. #1
    New Lounger
    Join Date
    Oct 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Importing Word Document (2000)

    I am trying to import Word templates into an Access database. Can anyone direct me to appropriate modules?

  2. #2
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Importing Word Document (2000)

    What do you mean "trying to import Word templates into an Access database"?

    Are you trying to import the full .dot and store that in an OLE field?

    Are you trying to import the text from a template and store that in a textor memo field?

    Are you trying to import data from form fields and store the data in separate field in the db?

    We need a little more info to be able to help you out better.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  3. #3
    New Lounger
    Join Date
    Oct 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Importing Word Document (2000)

    Sorry for being unclear. I am a novice. What I have been doing is formatting a template as form fields (I think this is the correct terminology). It is an assessment template for an Occupational Therapist, working with infants ( my wife). The form does indeed have some comment areas (I think these would be called text fields) It also has a lot of yes/no data and some fields are drop down boxes, (IE: things like respiratory and heart rate). What I am trying to do is import this information into Access so that she can extrapolate data to show how the therapy is impacting her patients. I believe that this would constitute saving data in separate fields in the data base. I believe that these data points can be imported through the module tab of Access.
    I guess the question is, is there module code that can accomplish this task? Or am I on the wrong track?

  4. #4
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Importing Word Document (2000)

    OK, In that case that's fairly easy to do.

    You'll need a bit of background first. Read Part I of the Word Automation Articles I wrote here

    Now, here is some code that will take all the data from the Word Form (txtFileName is the full path to the Word document) and put it into an Access form that has identical field names

    <pre>'Get Reference to Word Application
    On Error Resume Next
    Set objWord = GetObject(, "Word.Application")
    'An error indicates there was no Word instace open
    ' so we need to creae a new Word Instance
    If Err.Number = 429 Then
    Set objWord = CreateObject("Word.Application")
    'Set flag to indicate we created a New Word Instance
    bolCreated = True
    End If
    'Enable Built in Error handling
    On Error GoTo 0
    'Show Word Instance
    objWord.Visible = True
    'Open selected File
    Set doc = objWord.Documents.Open(txtFilename, False, True)

    Dim ffl as Word.FormField

    'Loop trough the Word FormFields and populate Access Form fields
    ' (of the same name) with the data from Word
    For Each ffl In doc.FormFields
    'Populate Fields on
    Me.Controls(ffl.Name) = ffl.Result
    Next</pre>


    This should be a good starting place for you.

    If you are still having troubles, send me a Private Message and I will send you Part III of the series of articles I referred you to at the start. It is in editing waiting to be published, otherwise I'd just direct you to a URL to read it. Part III deals with exactly what you need.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  5. #5
    New Lounger
    Join Date
    Oct 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Importing Word Document (2000)

    I like the sound of FAIRLY EASY! I am looking foward (with watering mouth) to some reading but can't get (http://www.databaseadvisors.com/news...s/news0207.htm) to respond. Will continue to try. THANK YOU

  6. #6
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Importing Word Document (2000)

    If you can't get to it by tomorrow, post here and I will attach the article here.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  7. #7
    New Lounger
    Join Date
    Oct 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Importing Word Document (2000)

    Holy somokes! Got part 1 & 2. Wonderful. Will take some time to educate myself and will be back. I really appreciate to tips.
    Common knowledge is also not so common.

  8. #8
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Importing Word Document (2000)

    If you get stuck on anything, ask and we will help.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  9. #9
    New Lounger
    Join Date
    Oct 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word Automation Part I

    A few thoughts on Part 1;
    I believe that automation may also pertain to a data entry screen as well as formatting reports. Is this correct?

    In addition this would work just as well for .dot as .doc

  10. #10
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Automation Part I

    Steve,

    Something to keep in mind while reading these articles. I wrote them for Access Developers that need to use Word to output to. Part III (not published yet, is also aimed at Access developers, but this time getting data from a Word Fill-In Form into access)

    Now on to your questions:
    <hr>I believe that automation may also pertain to a data entry screen as well as formatting reports. Is this correct?<hr>
    I'm not sure I understand this question.

    <blockquote><hr>In addition this would work just as well for .dot as .doc
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  11. #11
    New Lounger
    Join Date
    Oct 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Automation Part I

    You are way ahead of me about having Word forms to output to, however I can see a lot of utility to this trick. I am guessing that end users will be familiar with the formatting options available in Word to enhance their reports. This could be a very good thing.

    What I was referring to about ("

  12. #12
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Automation Part I

    <hr>I assumed that my Word Form would substitute for the "Forms" in Access that are used for direct data entry into Access<hr>
    No. When I am talking about a Word Form, I'm not referring to UserForms (the pop-up forms that you create through the VBE) but to Fill-In Forms. An actual document with fields that the users can type into. I think you will understand better when I send you Part III tonight.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •