Results 1 to 10 of 10
  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Altnau, Thurgau, Switzerland
    Posts
    447
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word in access form (Access 2000 or greater)

    <typing with embarrasment>
    I did this some years ago and have forgotten how to.

    I would like to have aa form based on a table which contsins the paths to winword docs. When I change the record I want to display the selected file in an embedded copy of winword on a form for the user to edit it.
    What object do I need on the form and how do I get it to update the contents based on the path selected.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word in access form (Access 2000 or greater)

    You can put an unbound object frame on the form, and link it to a Word document. You could then change its SourceDoc property in the On Current event of the form.

    But you'll only see the first page of the Word document; you can't scroll through it. If you enable the frame, the user can double click it to open Word. I don't think that is what you intend.

  3. #3
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Altnau, Thurgau, Switzerland
    Posts
    447
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word in access form (Access 2000 or greater)

    Thanks Hans.
    Thats what I tried without success. When I changed the record it didn't update the doc. Do I need to force some event in the object?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word in access form (Access 2000 or greater)

    You must recreate the link:

    Me.OLEUnbound0.SourceDoc = Me.PathField
    Me.OLEUnbound0.Action = acOLECreateLink

    where OLEUnbound0 is the name of the OLE control, and PathField is the name of the text field containing the path+filename. The OLE control must be unlocked and enabled for this to work.

    Updating is very slow, though. You might be better off providing a hyperlink to the documents, so that the user can decide to open a document or not.

  5. #5
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Altnau, Thurgau, Switzerland
    Posts
    447
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word in access form (Access 2000 or greater)

    Runtime error 2793

    I have the code in the Form_Current event (and no other code at all)

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word in access form (Access 2000 or greater)

    Have you set Enabled to Yes and Locked to No for the OLE control? And did you set the OLE Type to Linked when you created the control? Otherwise, you'll get runtime error 2793.

  7. #7
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Altnau, Thurgau, Switzerland
    Posts
    447
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word in access form (Access 2000 or greater)

    A thousand thanks.

    (I feel a right idiot for not spotting that)

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word in access form (Access 2000 or greater)

    Why do you think I could reply so quickly? <img src=/S/smile.gif border=0 alt=smile width=15 height=15> I made the same mistake initially <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  9. #9
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Word in access form (Access 2000 or greater)

    If you can make your Word docs RTF files then you can do exactly what you want using the Rich Text Control.

    The updating is instantious if you do it this way, and you can scroll.
    Regards
    John



  10. #10
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Altnau, Thurgau, Switzerland
    Posts
    447
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word in access form (Access 2000 or greater)

    Thats a good idea, I'll bear it in mind.

Posting Permissions

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