0 Replies Latest reply: Mar 5, 2013 12:44 AM by Hani RSS

    OLE Write at footer of document

    Hani
      Hi

      I user oracle fusion middleware 11g, i want to write at word document by using OLE, the problem is i need to write in header and footer area, how can i do that? is there any property to write on it like position?

      DECLARE
       app OLE2.OBJ_TYPE;
       docs OLE2.OBJ_TYPE; 
       doc OLE2.OBJ_TYPE; 
       selection OLE2.OBJ_TYPE; 
       args OLE2.LIST_TYPE;
      BEGIN
      -- create a new document
       app := OLE2.CREATE_OBJ('Word.Application');
       OLE2.SET_PROPERTY(app,'Visible',1);
      
       docs := OLE2.GET_OBJ_PROPERTY(app, 'Documents');
       doc := OLE2.INVOKE_OBJ(docs, 'add');
      
       selection := OLE2.GET_OBJ_PROPERTY(app, 'Selection');
      
       -- insert data into new document from long item
       OLE2.SET_PROPERTY(selection, 'Text', 'Test Message');
      
       -- save document as example.doc
       args := OLE2.CREATE_ARGLIST;
       OLE2.ADD_ARG(args, 'c:\temp\example.doc');
       OLE2.INVOKE(doc, 'SaveAs', args);
       OLE2.DESTROY_ARGLIST(args);
      
       -- close example.doc
       args := OLE2.CREATE_ARGLIST;
       OLE2.ADD_ARG(args, 0);
       OLE2.INVOKE(doc, 'Close', args);
       OLE2.DESTROY_ARGLIST(args);
      
       OLE2.RELEASE_OBJ(selection);
       OLE2.RELEASE_OBJ(doc); 
       OLE2.RELEASE_OBJ(docs); 
      
      -- exit MSWord 
       OLE2.INVOKE(app,'Quit');
      END;