TWord multiple pages

TWord multiple pages

Postby Ladinilson » Fri Jan 28, 2022 1:13 pm

Good Morning

I needed to make a sheet of a Word file where it contains fields to be filled in, could create several pages and I tried with...

Code: Select all  Expand view

LOCAL oWord,a:=1
oWord := TWord():New()
oWord:OpenDoc( "C:\document\TEST.docx" )
DO WHILE a < 11
   oWord:STARTPAGE()
   oWord:Replace('@number', STRZERO(a,2)  )                  
   oWord:ENDPAGE()
   a++
ENDDO
oWord:Visualizar()
 


Thank you!
Ladinilson
 
Posts: 17
Joined: Wed Feb 04, 2009 9:38 pm

Re: TWord multiple pages

Postby karinha » Fri Jan 28, 2022 1:35 pm

Code: Select all  Expand view

#Include "FiveWin.ch"

FUNCTION Main()

   LOCAL nI, nCopias := 3  // em um GET o usuario escolhe, ok?

   // SetCopies
   FOR nI := 1 TO nCopias

      IMP_WORD_PAGES()  // multiples pages.

   NEXT

RETURN NIL

FUNCTION IMP_WORD_PAGES()

   LOCAL oWord

   oWord := TWord():New()

   oWord:OpenDoc( "C:\document\TEST.docx" )

   oWord:STARTPAGE()

   oWord:Replace('@number', STRZERO(a,2)  )

   oWord:ENDPAGE()

   oWord:Visualizar()

RETRUN NIL
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7795
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: TWord multiple pages

Postby Ladinilson » Fri Jan 28, 2022 1:43 pm

karinha wrote:
Code: Select all  Expand view

#Include "FiveWin.ch"

FUNCTION Main()

   LOCAL nI, nCopias := 3  // em um GET o usuario escolhe, ok?

   // SetCopies
   FOR nI := 1 TO nCopias

      IMP_WORD_PAGES()  // multiples pages.

   NEXT

RETURN NIL

FUNCTION IMP_WORD_PAGES()

   LOCAL oWord

   oWord := TWord():New()

   oWord:OpenDoc( "C:\document\TEST.docx" )

   oWord:STARTPAGE()

   oWord:Replace('@number', STRZERO(a,2)  )

   oWord:ENDPAGE()

   oWord:Visualizar()

RETRUN NIL
 


Regards, saludos.


So my friend it creates separate files and not pages in the same file
Ladinilson
 
Posts: 17
Joined: Wed Feb 04, 2009 9:38 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 88 guests