OLE - Creating header and footer in Word document using abap

Hi All,
I'm using OLE to create a WORD document from abap.
I need to insert a logo in the header and a footer text.
Does any one know how to insert a header/footer with abap ole ?
I tried to insert the logo as picture with:
call method of o_inlineshapes 'AddPicture' = o_logo
  exporting
  #1 = 'C:\logo3.jpg'.
but I can't put it in the place I want..
thanks,
Michal

call method of LOBJ_MS_WORD 'ActiveWindow' = w_activewindow.
call method of lobj_activewindow 'ActivePane' = w_activepane.
call method of lobj_activepane 'View' = w_activeview.
SET PROPERTY OF w_activeview 'SeekView' = '9'.   " header view.
" This will set the view to the header view. Whatever you write here
will go to the header.
Get PROPERTY OF lobj_ms_word 'Selection' = w_selection.
CALL METHOD OF w_selection 'TypeText'exporting
  #1 = 'Rahul Anand'.
"Now set the view again to the main doc view.
   SET PROPERTY OF w_activeview 'SeekView' = '0'.
" Now write your main doc code .
" For footer the view is '10'.
call method of LOBJ_MS_WORD 'ActiveWindow' = w_activewindow.
call method of lobj_activewindow 'ActivePane' = w_activepane.
call method of lobj_activepane 'View' = w_activeview.
SET PROPERTY OF w_activeview 'SeekView' = '9'.   " header view.
" This will set the view to the header view. Whatever you write here
will go to the header.
Get PROPERTY OF lobj_ms_word 'Selection' = w_selection.
CALL METHOD OF w_selection 'TypeText'exporting
  #1 = 'Rahul Anand'.
"Now set the view again to the main doc view.
   SET PROPERTY OF w_activeview 'SeekView' = '0'.
" Now write your main doc code .
" For footer the view is '10'.

Similar Messages

  • Set header and footer in word file

    Through jsp file I am printing contents in word doc .
    response.setHeader("content-disposition","attachment; filename = filename.doc");
    But I am not able to print header and footer in word doc.
    In jsp I am having tabular format for generating star report.
    Please help.

    Hi Supareno,
    Can u tell me in details with small code, If it's
    possible for you .
    regards
    karandefine an header (coordinate 0,0)
    optional {
    a CustomItem? (coordinate 0, 0+header.getHeight() )
    another CustomItem ? (coordinate 0, CustomItem.getY() + CustomItem.getHeight() )
    etc...
    define footer (coordinate 0, getHeight() - footer.getHeight() )
    Message was edited by:
    supareno

  • Creating Header and Footer in ALV

    hi,
    can anyone please tell how will you create Header and Footer in ALv and Classical Report.

    Hi,
    In classical report use events 'top-of-page' for header and 'end-of-page' for footer.
    in ALV
    follow this link
    http://www.sap-img.com/abap/test-alv-display-with-header-footer.htm
    http://sap.ittoolbox.com/groups/technical-functional/sap-dev/header-footer-display-in-alv-grid-for-layout-description-344391
    Regards and Best wishes.

  • How to create Header and Footer  template

    Hi,
    I am wondering if this is possible, if yes , can some help me please?
    At present we have preprinted stationary for invoices and now the plan is to get rid of preprinted stationary and print header and footer via oracle reports directly. The address on header has to be dynamic because our organization has multiple offices across various countries. I am wondering if its possible to create a separate report only with a header and footer and reference it in other reports so that when printed both are merged and presented as single invoice. My reports knowledge is around basic level but i am good at plsql , if someone hear can please guide me HOW TO implement this logic I will be very grateful.
    We are using Oracle reports 6
    Thanks
    Aali
    Edited by: aali on 05-Jul-2010 05:44
    Edited by: aali on 05-Jul-2010 06:09

    Hello,
    You can set the header and footer dynamically.
    In the report layout section. There is one option called Edit Margin beside the Help iconic button.
    When you will press that button Edit Margin it will open for the new look your report fields and frames inside the black dense lined frame. So at the top of that main frame you can set the Header and same at the bottom you can set the Footer.
    And in your case if you want to set dynamic. Then while running the report. Send the dynamic values into the parameters and when you will create field in layout section Header/Footer then set the source as parameter which you passed. So, it will change dynamically.
    -Ammad

  • HT1349 how  do you remove the header and footer from a document

    how  do you remove the header and footer from a document

    It depends upon the app you are using.

  • How do i add images in the header and footer to a PDF using iText

    Hi ,
    I want to add images to the header and footer of every page while i am genrating a pdf i have created a separate class called EndPage which i am instanceiating its default constructor in another class 's button action method.
    The above code genrates a PDF for me however it genrates a file with file size zero bytes and does not open it following is my sample code
    //**********Any Help would be appreciated
    Thank You
    public class My_Class
    public String pdf_action()
    EndPage ep=new EndPage();
    return null;
    }//My_class Ends
    class EndPage extends PdfPageEventHelper
    * Demonstrates the use of PageEvents.
    * @param args no arguments needed
    public EndPage()
    try {
    com.lowagie.text.Document document = new Document(PageSize.A4, 50, 50, 70, 70);
    PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("D://proposals/endpage.pdf"));
    writer.setPageEvent(new EndPage());
    document.open();
    String text = "Lots of text. ";
    for (int k = 0; k < 10; ++k)
    text += text;
    document.add(new Paragraph(text));
    document.close();
    catch (Exception de) {
    de.printStackTrace();
    public void onEndPage(PdfWriter writer, Document document) {
    try {
    Rectangle page = document.getPageSize();
    PdfPTable head = new PdfPTable(3);
    for (int k = 1; k <= 6; ++k)
    head.addCell("head " + k);
    head.setTotalWidth(page.width() - document.leftMargin() - document.rightMargin());
    head.writeSelectedRows(0, -1, document.leftMargin(), page.height() - document.topMargin() + head.getTotalHeight(),
    writer.getDirectContent());
    PdfPTable foot = new PdfPTable(3);
    for (int k = 1; k <= 6; ++k)
    foot.addCell("foot " + k);
    foot.setTotalWidth(page.width() - document.leftMargin() - document.rightMargin());
    foot.writeSelectedRows(0, -1, document.leftMargin(), document.bottomMargin(),
    writer.getDirectContent());
    catch (Exception e) {
    throw new ExceptionConverter(e);
    }

    Hi,
    Thanks for the quick response.
    The problem is that when I keep the logo as a watermark, the pdf is not adjusting itself to include the logo as header.
    But if I add a header text via Tools -> Headers and Footers, the pdf is adjusting itself so that the header text is at the beginning , not overlapping with the contents of pdf.
    But while using logo as watermark, some times overlapping of the pdf contents and logo is happening.
    Is there any way to add a logo in the Header and Footer via the option in Tools -> Headers and Footers
    Thanks,
    Vidhya

  • Remove Header and footer from Word Docs

    Is it possible to remove the header/footer from Word docs?
    The html output from ctx_doc.markup gets the header/footer and (specialy)page numbers all messed up.
    []'s
    thanks

    Please define 'messed up'. I'll reproduce here and then try to find a cause/solution. I checked a couple of other forums and Metalink with no good discussion on the topic.
    -Ron

  • How do I save and access MS Word documents using iCloud?

    How do I access my old documents in iDisk and how do I save new documents created in MS word so they are available to me in the cloud?  Do I need to install keynote, numbers and pages now?  Before I just accessed my ME account from any computer and worked on a document while I was travelling.  Am I now required to have those Apple apps on a computer just to access my documents? 

    Thank you for trying to help.  I'm still lost.  I found a post that showed me how to get my iDisk back (https://discussions.apple.com/message/16336273#16336273).  I still don't understand how to save a word document that I create on my Mac so that I can access it through the cloud on a PC at work. 

  • How to add specific header and footer to flat file using SSIS 2008

    The SSIS package need to create file  with headers, totals and adds a status to position one of the records.
    Header: "$$ADD ID=ENTK0557 BID='IA   HBZAC14HBZACHRYCORP' PASSWORD='CUSTOMER        ' %AU HBZAC14" is added.
    $$ADD = Static
    ID=ENTK0557 = Static
    BID='IA   HBZAC14HBZACHRYCORP' = "HBZAC14" is the company, "HBZACHRYCORP" is company name
    PASSWORD='CUSTOMER        '  = static
    HBZAC14 = company
    Control Totals:
    T010533343 000050 0002659604 000000 0000000000
    T = Totals
    010533343 = Account Number
    000050 = Total records
    0002659604 = Total checks
    000000 = TBD
    0000000000 = TBD
    Data for the file
    DECLARE
    @T AS
    TABLE
    [BR-ISSUE-VOID-IND] [char]
    (1)
    NULL,
    [BR-ACCT-NBR] [varchar]
    (9)
    NULL,
    [FILLER1] [char]
    (1)
    NULL,
    [BR-SERIAL-NBR] [varchar]
    (8000)
    NULL,
    [BR-CHECK-AMT] [varchar]
    (8000)
    NULL,
    [BR-CK-ISSUE-DATE] [varchar]
    (6)
    NULL
    INSERT
    INTO @T
    [BR-ISSUE-VOID-IND]
    [BR-ACCT-NBR]
    [FILLER1]
    [BR-SERIAL-NBR]
    [BR-CHECK-AMT]
    [BR-CK-ISSUE-DATE]
    SELECT
    'C'
    ,NULL,' ',30090072,2114.39,100502
    UNION
    ALL
    SELECT
    'C'
    ,NULL,' ',30090190,430.58,100502
    UNION
    ALL
    SELECT
    'C'
    ,NULL,' ',30092371,589.93,100502
    UNION
    ALL
    SELECT
    'C'
    ,NULL,' ',30092550,1198.6,100502
    SELECT
    FROM @T
    File SnapShot.

    Using SSIS its difficult unless you use a script task after the data flow to add the header footer bits.
    A much better option in this case would be bcp as you can generate query with values in the order you want and bcp it out
    http://msdn.microsoft.com/en-us/library/ms162802.aspx
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to set a page header and footer of an excel file i'm creating

    Hello !
    SORRY MY ENGLISH is very BAD.
    I tried to set page header and footer in Excel sheet with ABAP  ole
    DATA : BEGIN OF enter,
    x(1) TYPE x VALUE '0D',
    END OF enter.
    DATA : format(255) TYPE c.
    FORM set_page_sheet.
    CALL METHOD OF excel 'ActiveSheet' = sheet.
    CALL METHOD OF sheet 'PageSetup' = pagesetup.
    SET PROPERTY OF pagesetup 'Orientation' = xllandscape.
    SET PROPERTY OF pagesetup 'PrintTitleRows' = '$9:$12'.
    CLEAR format.
    ERROR
    CONCATENATE 'PAGESHEET' enter-x 'PAGE &P/&N' INTO format.
    ERROR
    SET PROPERTY OF pagesetup 'RightHeader' = format.
    CLEAR format.
    CONCATENATE ' Text 1 ' enter-x 'Text 2'
    enter-x 'Text 3 ' INTO format.
    SET PROPERTY OF pagesetup 'RightFooter' = format.
    FREE OBJECT pagesetup.
    ENDFORM. " set_page_sheet
    Activate report -
    ERROR - The enter-x must by data type c or another then data type x
    Thanks for answer.

    Try to define ENTER this way & try
    class cl_abap_char_utilities definition load.
    DATA : BEGIN OF enter,
    x type c value cl_abap_char_utilities=>cr_lf,
    END OF enter.
    PS : I am not 100% sure about this.

  • Pages 5.2 How do I remove the fields in the header and footer?

    I need to add objects and footers that are longer than the field dividers allow in the header and footer of my document. How do I remove the field divisions?

    You can't remove the dividers in Pages 5.
    They don't exist in Pages '09.
    On the Mac you can simply keep typing and the text crosses the dividers.
    A quick test on my iPod touch suggests the same on iOS.
    Peter

  • Header and footer area in alv

    Hi All,
           What is the use of Header and Footer Area (Top of List & End of List ) in ALV table. Can any one explain me..
    Thanks,
    Susil

    hi ,
    In the below link there is an example for creating top of list end end of list.. in this the header and footer are displayed outside the ALV table.. My question is what is the use of the header and footer even I can use UI's to display the header and footer...
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b0ee06d0-d475-2b10-ddad-bc4bf134cfb8?overridelayout=true
    Thanks,
    Susil.

  • How do you print from safari without the header and footer?

    I may be missing something but...
    When printing in Safari how do you remove the header and footer.  I am using PDF creator to save pages as PDF for things like online pay slips and want them to be 'clean'.
    Running Safari 5.1 on Windows Vista
    Thanks in advance for any help.
    Mark

    I may be missing something but...
    When printing in Safari how do you remove the header and footer.  I am using PDF creator to save pages as PDF for things like online pay slips and want them to be 'clean'.
    Running Safari 5.1 on Windows Vista
    Thanks in advance for any help.
    Mark

  • Header and footer template

    I would like build an app with a header and footer which will
    be used. What is the best practice for this type of layout?
    Any template I can use? Thanks.

    Lots of ways, depending, but consider mx:Application with
    layout="absolute", then using a header and footer components
    positioned using "top" and "bottom" constraints.
    Tracy

  • Header and footer scenario

    To concatenate  Header and Footer , You have to use Joiner Transformation and Join with a Dummy Condition. In first there will be columns like file name, date , time  and in second there will be column like trailer record count and amount , so after join , u can have all these column in single row.

    Hi All, I have a requirement from client that i need to implement either through Informatica logic or through unix logic. Please suggest.  I have a source file which contains header , body , trailer . I need to load the body into one target table and load header and trailer to one table. in informatica. H|RRS_LECS_001|2015-05-08|04:05:475|20150329|1|980100001|0005|20150329|1|303001002|0005|20150329|1|442101001|0005|20150329|1|440002099|000T|4|24145254007293.16  Here the first line is header having filename, business date and time .Then next 4 are actual records and last row is the trailer part which contains trailer record and one amount column. I need to load the actual data to one table i.e. 5|20150329|1|980100001|0005|20150329|1|303001002|0005|20150329|1|442101001|0005|20150329|1|440002099|000 and header file name, date , time , trailer record count and amount in one table RRS_LECS_001 , 2015-05-08 , 04:05:47, 4 , 24145254007293.16  Please suggest how to do this.

Maybe you are looking for

  • My computer crashed, i have my library on an external drive, so how do i get it back into itunes?

    Okay so my dad keeps refusing to get a new computer, or a separate laptop for me. Iritatingly, it continues to crash so severely that the hardrive has been wiped clean and restored at least 4 times. Ridiculous. Luckily, I was able to save my library

  • Exit code 6: Premiere Pro CS6 [was: Error re]

    I need to reinstall Premiere Pro CS6, but I keep getting error messages: Exit Code: 6 Please see specific errors below for troubleshooting. For example,  ERROR: DF024 ... -------------------------------------- Summary --------------------------------

  • Mac mini, bluetooth connection problems

    Hi, My mac mini (latest model) has recently got problems with the bluetooth connections to the keyboard and the mouse. It seems to be some kind of interference to the wireless signal that makes the KB/Mouse to lose connection, and then connect again.

  • EPM 11.1.2.3 Install - machine name change problem

    Hi, when I thought I had 99% completed an install a problem was discovered with the machine name, which was changed, is there any simple way to reinvoke the configuration options from the initial install, or to change the entries (config files / xml?

  • E-Recruitment - Issue in TREX

    Hi, I have got the TREX setup done by my basis team. I have also configured the Talent group in ECC portal. I also have some of the applicants assigned to the talent groups. But still i could'nt get the search options working in E-rec Ex:- Job search