General information
Category:
Coding, syntax & commands
Hi all,
I have to export to the Word but I need someone wiiling to help me on pagebreak each time the process changes the employee number as with the following codes :
nOLEerror=0
on error nOLEerror=error()
oWord=CreateObject('Word.Application')
on error
if nOLEerror=0
nTop=0
nLeft=0
wait 'Opening Word' window nowait
with oWord
.visible=.T.
.Documents.Add
select CTEMP6
go top
cEmpno=''
scan
if cEmpno#EMPNO
if !empty(cEmpno) && New Page - do header
.Selection.InsertBreak() &&* put in code for pagebreak
endif
with .Selection
.font.name='arial'
.font.size=14
.font.bold=.t.
.TypeText("TITLE ABC ")
ENDWITH
.Selection.TypeText('EMPNO :')+empno
.Selection.TypeText(MEMO+chr(13))
endscan
endwith
else
=messagebox('Unable to create Word File',0+48+0,'EXPORT ERROR')
endif
if used('ctemp6')
USE IN ctemp6
endif
Please correct my codes if necessary or guide me ?
TIA
PP
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only