03-17-2009 4:40 PM
Hi all
Users want me to print a word document from within an abap program.
Is this possible ?
No data is being passed to the document and it's way to complex to create in smart forms.
would something like this work ?
CREATE OBJECT WORD 'Word.Application'.
SET PROPERTY OF WORD 'Visible' = 1.
CALL METHOD OF WORD 'Open'
EXPORTING #1 = 'PATH AND FILE NAME'.
CALL METHOD OF WORD 'RUN' EXPORTING #1 = 'OPEN1'.
any help much appreciated !
Hugh
03-17-2009 5:40 PM
Check this
report zars no standard page heading
line-size 170
line-count 65(4).
include ole2incl .
data: v_word type ole2_object ,
v_documents type ole2_object ,
v_newdoc type ole2_object ,
v_actdoc type ole2_object .
start-of-selection .
create object v_word 'WORD.APPLICATION'.
set property of v_word 'Visible' = '0' .
call method of v_word 'Documents' = v_documents.
call method of v_documents 'Open' = v_newdoc
exporting #1 = 'c: est.doc' .
call method of v_word 'ActiveDocument' = v_actdoc .
call method of v_actdoc 'PrintOut' .
call method of v_word 'Quit' .
end-of-selection.
free: v_word, v_actdoc, v_documents, v_newdoc .
PS : This code i found in the same forum few manths back
a®
03-17-2009 5:40 PM
Check this
report zars no standard page heading
line-size 170
line-count 65(4).
include ole2incl .
data: v_word type ole2_object ,
v_documents type ole2_object ,
v_newdoc type ole2_object ,
v_actdoc type ole2_object .
start-of-selection .
create object v_word 'WORD.APPLICATION'.
set property of v_word 'Visible' = '0' .
call method of v_word 'Documents' = v_documents.
call method of v_documents 'Open' = v_newdoc
exporting #1 = 'c: est.doc' .
call method of v_word 'ActiveDocument' = v_actdoc .
call method of v_actdoc 'PrintOut' .
call method of v_word 'Quit' .
end-of-selection.
free: v_word, v_actdoc, v_documents, v_newdoc .
PS : This code i found in the same forum few manths back
a®
03-18-2009 10:25 AM