• DOCPROPERTY will not work! (Win2kSP4/Office2KSP3)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » DOCPROPERTY will not work! (Win2kSP4/Office2KSP3)

    Author
    Topic
    #409302

    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!

    Viewing 1 reply thread
    Author
    Replies
    • #871185

      The typetext method works , What are the other methods ?

      Can you provide a link to the downloadable db ?

      • #871215

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

        Here’s the link to her file:

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

        • #871219

          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…

          • #871239

            Peter, the download from the link works fine here.

            Check your references to see if something is missing.

            • #871251

              I’ve added the only reference i did not have compared to your screen shot, MS Office, and still no joy… ๐Ÿ™

            • #871271

              Now not even the typetext works…..

              BTW, i am running Office 2k with Outlook 2002

            • #871294

              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.

            • #871664

              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??

            • #871666

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

            • #871850

              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….

            • #871858

              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/archtemplate.asp?v4-n29%5B/url%5D

            • #871859

              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/archtemplate.asp?v4-n29%5B/url%5D

            • #871851

              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….

            • #871667

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

            • #871665

              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??

            • #871295

              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.

            • #871272

              Now not even the typetext works…..

              BTW, i am running Office 2k with Outlook 2002

            • #871252

              I’ve added the only reference i did not have compared to your screen shot, MS Office, and still no joy… ๐Ÿ™

          • #871240

            Peter, the download from the link works fine here.

            Check your references to see if something is missing.

        • #871220

          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…

      • #871216

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

        Here’s the link to her file:

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

    • #871186

      The typetext method works , What are the other methods ?

      Can you provide a link to the downloadable db ?

    Viewing 1 reply thread
    Reply To: DOCPROPERTY will not work! (Win2kSP4/Office2KSP3)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: