none
word app in vb.net RRS feed

  • Question

  • hi experts, in vb.net is there a way to  check how many pages are there in a particular document?

    thanks any input is greatly appreciated. :)


    Every second counts..make use of it.
    Wednesday, November 16, 2011 7:58 AM

All replies

  • Could you please be more specific about what you mean by "vb.net"? A Windows form? A Console app? Something else?

    What kind of Word document (created in which version of Word)?

    What else does your project need to do with Word and/or this document?


    Cindy Meister, VSTO/Word MVP
    Wednesday, November 16, 2011 9:08 AM
    Moderator
  • Hi Cindy, thanks for your reply. actually, i'm using vb express 2010 and office 2007.

    i just want to get  the number of pages from a word document using vb.net code.

    i found this snippet from the internet but it just doesn't work:

     

    word_server = New Word.Application

    Dim Doc As Word.Document

    Doc = word_server.Documents.Open(FilePath)

    numpages = Doc.ComputeStatistics(wdStatisticPages)

    msgbox numpages


    can help to do this in vs 2010 express ed., thanks


    Every second counts..make use of it.
    Thursday, November 17, 2011 7:35 AM
  • Hi cguan

    The code should work, in principle. Please tell us exactly HOW it doesn't work for you.


    Cindy Meister, VSTO/Word MVP
    Thursday, November 17, 2011 9:54 AM
    Moderator