Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2002
    Location
    Norway
    Posts
    239

    Post Unanswered: Obtain pages in a Word document

    Hi.

    I like to obtain the number of pages in a MS-Word document from MS-Access. Can anyone help ?

    Thanks a lot.

  2. #2
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173

    Re: Obtain pages in a Word document

    First in the module section of your database set a reference to Microsoft Word XX object Library. To set the reference ... use Tools, Reference while in a module ...

    Then use this code to get the number of pages

    Dim wd As New Word.Application
    Dim wddoc As Word.Document
    Dim intPages As Integer
    Dim strDocument As String


    strDocument = "c:\test.doc"
    Set wddoc = wd.Documents.Open(strDocument)
    intPages = wddoc.BuiltInDocumentProperties("Number of Pages")


    Originally posted by vestigo
    Hi.

    I like to obtain the number of pages in a MS-Word document from MS-Access. Can anyone help ?

    Thanks a lot.
    Mona
    ________________________________
    Life is too short to be sane or sensible. Weird people rule and normal people suck

  3. #3
    Join Date
    Nov 2002
    Location
    Norway
    Posts
    239

    Smile

    Thanks.

    You put me on the right track.
    I used the following to obtain number of pages in the word document:

    "ActiveDocument.BuiltInDocumentProperties(wdProper tyPages)"



    By the way, Vestígő; Latin verb for investigate, search
    And certainly, now I have found a place where to search


    once again, thank’s a lot

  4. #4
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173
    You're welcome

    Hope you had a good weekend.


    Originally posted by vestigo
    Thanks.

    You put me on the right track.
    I used the following to obtain number of pages in the word document:

    "ActiveDocument.BuiltInDocumentProperties(wdProper tyPages)"



    By the way, Vestígő; Latin verb for investigate, search
    And certainly, now I have found a place where to search


    once again, thank’s a lot
    Mona
    ________________________________
    Life is too short to be sane or sensible. Weird people rule and normal people suck

Posting Permissions

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