Reading number of pages in a Word-document (docx)

Reading number of pages in a Word-document (docx)

Postby driessen » Thu Oct 08, 2020 10:16 pm

Hello,

I need to know in my FWH-application how many pages there are in a Word-document (docx).

Does anyone know how to accomplish this?

Thank you very much in advance.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Reading number of pages in a Word-document (docx)

Postby RAMESHBABU » Fri Oct 09, 2020 1:33 am

Hello Mr.Michel,

I need to know in my FWH-application how many pages there are in a Word-document (docx).
Does anyone know how to accomplish this?


Code: Select all  Expand view

nPages := oWord:ActiveDocument:ComputeStatistics(wdStatisticPages) // (wdStatisticPages Constant Value is 2)
 


-Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Re: Reading number of pages in a Word-document (docx)

Postby driessen » Fri Oct 09, 2020 9:05 am

Thank you so much.
You are a great help.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Reading number of pages in a Word-document (docx)

Postby driessen » Sat Oct 28, 2023 4:15 pm

Hello everyone,

I tried to use the suggested solution to my question.
I need to read the number of pages in a Word document.
Unfortunately, I get an error : "Unexported method: Active Document.

Anyone with a suggestion for a solution?

Thank you very much for any help.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Reading number of pages in a Word-document (docx)

Postby Natter » Sat Oct 28, 2023 9:37 pm

Write like this:

oDoc:=oWrd:Documets:Open(..
nPages := oDoc:ComputeStatistics(wdStatisticPages)
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Reading number of pages in a Word-document (docx)

Postby driessen » Sat Oct 28, 2023 9:54 pm

Mr. Notter,

Thank you very much for your help.
It's working just fine now.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 87 guests