Changing MS-WORD Header and Footer-text with FORMS and OLE

From: Rene <rene_at_renek.nl.eu.org>
Date: Fri, 18 Feb 2000 17:11:17 GMT
Message-ID: <38ad7ce2.2235694_at_weber.a2000.nl>



Please, help

I am using OLE to transfer data from FORMS 4.5 to MS-Word 97. Inserting oracle data into a document works fine. Inserting oracle data into a Header or a Footer works fine also.

But I don't know how to CHANGE the content of the header and footer.

The example below shows how to SET text into a footer or header. I like to know what to change to let the procedure CHANGE the content of the header and/or footer.

Can somebody please help me ?

Thanks in advance,
Rene
rene_at_renek.nl.eu.org

procedure SetHeaderFooterText(DocumentHandle in OLE2.OBJ_TYPE, SectionNo in PLS_INTEGER,
Text in VARCHAR2, Type in PLS_INTEGER) is

    hSection OLE2.OBJ_TYPE;
    hSections OLE2.OBJ_TYPE;

    hHFs          OLE2.OBJ_TYPE;
    hHF           OLE2.OBJ_TYPE;    
    hRange    OLE2.OBJ_TYPE;
    hArgs     OLE2.LIST_TYPE;
    vcType        VARCHAR2(10);
  begin
        -- Get the handle to the requested Section
        hSections := OLE2.GET_OBJ_PROPERTY(DocumentHandle,'Sections');
        hArgs       := OLE2.CREATE_ARGLIST; 
        OLE2.ADD_ARG(hArgs,SectionNo);
        hSection := OLE2.INVOKE_OBJ(hSections,'Item',hArgs); 
    OLE2.DESTROY_ARGLIST(hArgs);     

    if Type = 1 then /* Header */

        vcType := 'Headers';
    else

        vcType := 'Footers';
    end if;     

  • Get the Primary Header or footer object hHFs := OLE2.GET_OBJ_PROPERTY(hSection,vcType); hArgs := OLE2.CREATE_ARGLIST; OLE2.ADD_ARG(hArgs,1); hHF := OLE2.INVOKE_OBJ(hHFs,'Item',hArgs); OLE2.DESTROY_ARGLIST(hArgs);
  • Get the Range for that hRange := OLE2.GET_OBJ_PROPERTY(hHF,'Range');
  • Set the Text for that OLE2.SET_PROPERTY(hRange,'Text',Text);
    OLE2.RELEASE_OBJ(hRange);
    OLE2.RELEASE_OBJ(hHF);
    OLE2.RELEASE_OBJ(hHFs);
    OLE2.RELEASE_OBJ(hSection);
    OLE2.RELEASE_OBJ(hSections);

 end; Received on Fri Feb 18 2000 - 18:11:17 CET

Original text of this message