cancel
Showing results for 
Search instead for 
Did you mean: 

Set Left/RightSideVacuum Width to Page of MSWord File Which Created WithOLE

Former Member
0 Kudos

Moderator message: please do not post the same question in more than one forum. Duplicate deleted.

Hi,

i want to set left/right side vacuum width to page of ms word file which created with ole.

How can i change page attributes (page width-height size, page horizontal-vertical direction etc.) of ms word file which created with OLE?

this is my working code;

*-- create word file
DATA: gs_word         TYPE ole2_object ,
      gs_documents    TYPE ole2_object ,
      gs_newdoc       TYPE ole2_object ,
      gs_selection    TYPE ole2_object ,
      gs_application  TYPE ole2_object ,
      gs_actdoc       TYPE ole2_object .
 
  CREATE OBJECT gs_word 'WORD.APPLICATION' .
  IF sy-subrc NE 0 .
    MESSAGE s000(su) WITH 'Error while creating OLE object!'.
    LEAVE PROGRAM .
  ENDIF .
 
  SET PROPERTY OF gs_word 'Visible' = '0' .
  CALL METHOD OF gs_word 'Documents' = gs_documents.
*  CALL METHOD OF gs_documents 'Add' = gs_newdoc.
p_file = l_word_string.
  CALL METHOD OF gs_documents 'OPEN'
EXPORTING
#1 = p_file.
*  call method of gs_newdoc 'Activate' = gs_actdoc.
 
CALL METHOD OF gs_word 'ActiveDocument' = gs_actdoc .
 
GET PROPERTY OF gs_actdoc 'Application' = gs_application .
 
 
  GET PROPERTY OF gs_word 'Selection' = gs_selection.
 
   CALL METHOD OF gs_actdoc 'SaveAs'
    EXPORTING
      #1 = p_file "'C:\file.doc'          "filename
      #2 = 1                      "fileFormat
      #3 = 0                      "LockComments
      #4 = sy-uname             "password to open a workbook
      #5 = 0                      "AddToRecentFiles
      #6 = sy-uname.             "password for write access
 
*CALL METHOD OF gs_actdoc 'PrintOut' .
 
    CALL METHOD OF gs_word 'Quit' .
 
    FREE: gs_word, gs_actdoc, gs_documents , gs_newdoc .
*--

Which the codes in ole can i add into my codes to change page attributes of ms word file?

Can somebody help me pls?

Thanks.

Edited by: Matt on Dec 18, 2008 2:26 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

matt
Active Contributor
0 Kudos

Please do not post the same question in more than one forum. Duplicate deleted.