04-21-2009 1:15 PM
Hi friends,
i want to print "confirmation letter" to MS-word document. is there any FM or sample program?.
Thanks & Regards.
Vallamuthu.M
04-21-2009 3:11 PM
Prints the file without interfering the user:
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:\Documents and Settings\jyrj\Desktop\Functional Specs\just for print.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.
04-21-2009 1:17 PM
Hi ,
Try method EXECUTE of class CL_GUI_FRONTEND_SERVICES .
Pass file name and parameter Operation as PRINT.
Hope it helps.
04-21-2009 1:21 PM
04-21-2009 1:26 PM
hi ,
you must use ABAP OLE , check this example :
type-pools ole2 .
CREATE OBJECT word 'WORD.APPLICATION' .
IF sy-subrc NE 0 .
MESSAGE s000(su) WITH 'Error while creating OLE object!'.
LEAVE PROGRAM .
ENDIF .
GET PROPERTY OF word 'documents' = documents.
CALL METHOD OF documents 'Add' = newdoc.
GET PROPERTY OF word 'Selection' = selection.
call method of selection 'TypeText'
exporting
#1 = 'Some data'.
call method of selection 'HomeKey'
exporting
#1 = 5
#2 = 1.
get property of selection 'Font' = font.
set property of font 'Bold' = 1.
check this link :
04-21-2009 2:47 PM
I want save the word doc in particular path also.
Thanks & Regards,
Vallamuthu.M
04-21-2009 3:08 PM
04-21-2009 3:11 PM
Prints the file without interfering the user:
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:\Documents and Settings\jyrj\Desktop\Functional Specs\just for print.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.
04-22-2009 6:12 AM
Hi ,
is there any method/class for "Next Page".
is there any method/class for next line and how to find the properties/object (eg: font, paragraph,table properties).
Thanks & Regards,
Vallamuthu.M
Edited by: vallamuthu madheswaran on Apr 22, 2009 11:04 AM
Edited by: vallamuthu madheswaran on Apr 22, 2009 3:33 PM
04-22-2009 2:33 PM
EPS_GET_FILE_ATTRIBUTES will get the attributes of file, but to get he font and other properties which are in the file is not possible to get.
04-23-2009 8:07 AM
Hi,
How to give the "New Page" or "Next page"?
Thanks & Regards,
Vallamuthu.M
04-23-2009 3:46 PM
I have tested it... if the word document has 3 pages all the pages are getting printed.
04-24-2009 5:50 AM
Hi,
I'm having 15 line word document for a vendor.
if i give 30 vendor then it print 30 pages but here i gave more than one vendor the allignment is not properly.
Thanks & Regards,
Vallamuthu.M