Results 1 to 12 of 12
  1. #1
    2 Star Lounger
    Join Date
    Jun 2002
    Location
    Barnsley, Yorkshire, England
    Posts
    108
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DOCPROPERTY will not work! (Win2kSP4/Office2KSP3)

    Hi everyone.

    Have spent hours trying to get this to work but to no avail.

    OK, Win2K SP4 and Office 2000 SP3.

    Have downloaded Helen Feddema's database that demonstrates 4 different ways to populate a Word doc with data from Access.

    The typetext method works, but none of the others do. Each time, it runs the code, opens the word doc, and then finishes. I've tried setting a break point and stepping through the code, and all the variables are being read from the table so it would seem it's the actual insertion that's not working.

    I have the following references showing in Access: VBA, Access 9, Word 9, OLE Automation, DAO 3.6 and VBA Extensibilty 5.3.

    Hoping someone can help before i pull all of my hair out!

  2. #2
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DOCPROPERTY will not work! (Win2kSP4/Office2KSP3)

    <font color=blue>The typetext method works</font color=blue> , What are the other methods ?

    Can you provide a link to the downloadable db ?

  3. #3
    2 Star Lounger
    Join Date
    Jun 2002
    Location
    Barnsley, Yorkshire, England
    Posts
    108
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DOCPROPERTY will not work! (Win2kSP4/Office2KSP3)

    The other three methods are: Bookmark, Mailmerge and Docproperty.

    Here's the link to her file:

    http://www.helenfeddema.com/pub/accarch44.zip

  4. #4
    2 Star Lounger
    Join Date
    Jun 2002
    Location
    Barnsley, Yorkshire, England
    Posts
    108
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DOCPROPERTY will not work! (Win2kSP4/Office2KSP3)

    Oops. the link should be:

    ftp://ftp.helenfeddema.com/pub/accarch44.zip

    I have been told by two other people that it works ok, suggesting it is my pc...

  5. #5
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DOCPROPERTY will not work! (Win2kSP4/Office2KSP3)

    Peter, the download from the link works fine here.

    Check your references to see if something is missing.

  6. #6
    2 Star Lounger
    Join Date
    Jun 2002
    Location
    Barnsley, Yorkshire, England
    Posts
    108
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DOCPROPERTY will not work! (Win2kSP4/Office2KSP3)

    I've added the only reference i did not have compared to your screen shot, MS Office, and still no joy... :-(

  7. #7
    2 Star Lounger
    Join Date
    Jun 2002
    Location
    Barnsley, Yorkshire, England
    Posts
    108
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DOCPROPERTY will not work! (Win2kSP4/Office2KSP3)

    Now not even the typetext works.....

    BTW, i am running Office 2k with Outlook 2002

  8. #8
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DOCPROPERTY will not work! (Win2kSP4/Office2KSP3)

    Peter

    I'm running the same setup as you other than WinXP
    Do you have office 10 components ? MSWORLD.OLB ?

    You may have to reference it.

  9. #9
    2 Star Lounger
    Join Date
    Jun 2002
    Location
    Barnsley, Yorkshire, England
    Posts
    108
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DOCPROPERTY will not work! (Win2kSP4/Office2KSP3)

    I assume you meant msword.olb. No, i do not have it installed anywhere on my system.

    Should i need it?? Is there somewhere i can download it??

  10. #10
    2 Star Lounger
    Join Date
    Jun 2002
    Location
    Barnsley, Yorkshire, England
    Posts
    108
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DOCPROPERTY will not work! (Win2kSP4/Office2KSP3)

    OK< to be more precise, i do have msword9.olb.

  11. #11
    2 Star Lounger
    Join Date
    Jun 2002
    Location
    Barnsley, Yorkshire, England
    Posts
    108
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DOCPROPERTY will not work! (Win2kSP4/Office2KSP3)

    OK, some more info...

    Still not working so have tried deleting all references, rebooting, and reattaching them. - no difference.

    I have used some debug.print commands and worked out that the variables from the access table are being read to the objWord.ActiveDocument.CustomDocumentProperties which suggests the word library has been registered properly.

    Next bit of code populates the word doc:

    objWord.Selection.WholeStory
    objWord.Selection.Fields.Update
    objWord.Selection.HomeKey Unit:=6
    objWord.Visible = True
    objWord.Activate

    The document is opened and is visible, but the fields are not being populated, suggesting it's the update line that is not working.

    The rest of the code runs fine with tht table of products being populated perfectly.

    So it would seem the problem lies with this line:

    objWord.Selection.Fields.Update

    If it helps, i note that there is no dropdown box when a . is typed like you would normally get....

  12. #12
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DOCPROPERTY will not work! (Win2kSP4/Office2KSP3)

    Peter
    I'm not sure what the problem is, but check the attached link.
    It looks like Woody has been down the same route as you and rewritten some of the code.
    I hope it helps you.
    Scroll down the page to see the article.

    http://www.woodyswatch.com/office/ar...ate.asp?v4-n29

Posting Permissions

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