OLE Write at footer of document

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;

Hi Srivani,
I guess you have added your footer related data in Footer tab of Mainwindow->Table. You have to just fix the space for footer texts...This can be achieved if you create a secondary window just below your main window so that space will be fixed for footer(i.e. footer will always be displayed here irrespective of line items in your main window). Now place your footer data in this window.
I hope you got the trick....
BR,
Vinit

Similar Messages

  • PC/64/Windows 7/XIStandard recently installed/unable to put footer into document because I can't move to the bottom of the image when in footer application mode.  Display is at recommended 1920x1080.  Is there a solution or is it a flaw in the program?

    PC/64/Windows 7/XIStandard recently installed/unable to put footer into document because I can't move to the bottom of the image when in footer application mode.  Display is at recommended 1920x1080.  Is there a solution or is it a flaw in the program?

    Don't have a direct answer. But did you install the updates. They might resolve the problem.

  • Read,write and create word document with list data

    Hi,
    My requirement is that I have a custom list called List1 and which has a 4 (suppose XName, location, phone, email)columns and also have a Template document(.dot). If I click on save button , new document has to create from the Template document(.dot) and
    should modify the content depends on list columns.
    For that I need to read the document , find out the text where XName , location,,phone, email and replace with the list item data(user entered data). 
    Can anybody please refer links for read,write and create word document?
    Thanks in advance.

    Yes, you can using Office Open XML. I found it to be a lot more cumbersome and in the end not a money saving approach:
    https://msdn.microsoft.com/en-us/library/office/bb448854.aspx?f=255&MSPPError=-2147217396
    Kind regards,
    Margriet Bruggeman
    Lois & Clark IT Services
    web site: http://www.loisandclark.eu
    blog: http://www.sharepointdragons.com

  • OLE error when opening word document

    Hi,
    I have a form that allows update of word documents stored in blob fields in the database.
    The form works fine. except that if I open and update a document that has a footer and then save the document back into the database without the footer, it is no longer possible to open it.
    Can anyone help?
    Sometimes I get FRM 40922 : An OLE error occurred 0x80004005
    Otherwise when I click on the icon nothing happens.
    Thank you
    Michael

    I can avoid this problem by leaving the footer and returning to the main document view before saving the document.

  • Any time I want to delete anything by dragging it to trash, my computer keeps on asking me for my password. And once I write my password, the document is deleted without actually going first to trash. How can I solve this?

    Hello there
    I need some help from you guys
    Any time I want to delete any thing by dragging to trash, my computer will ask me for my login password and once I write my password, the deleted document/file will not go to trash but it will be deleted instantly. How am I going to change this? Meaning drag documents/files to trash and than empty the trash. Can you help?
    Thanks
    Charles

    Normally, that's caused because of a permissions problem. Have a look at this site > http://www.thexlab.com/faqs/trash.html#Anchor-Files-46919

  • How to write 'into' a PDF-document ?

    hi there,
    i have a new small project to do with the following problem:
    i get a file (text-file) with invoices from an external system.
    I want to 'overlay' this file with a form, which is a PDF-document.
    the question is: is it possible to write 'into the PDF'-form the contents of the text-file ? if yes, how is it possible ?
    regards, Martin

    well,
    this is not what i need, sorry
    i don't want to convert the text-file into a PDF-file.
    i have an existing PDF-file (a FORM with all the overlay, like graphics, company-logo, etc....). and i have a text file. and i want to 'merge' the text into
    the pdf-file.
    regards, Martin

  • Report Writer and Report painter documents

    Hi
    If anyone have any documents regarding the report painter and writer, could you please send it to [email protected]?
    Documents with step by step creation of custom report from scratch...? or anything related to these...except the help.sap.com site links..
    Anyhelp is greatly appreciated...
    thank you
    thilothama

    Hi all,
    I am having this report s_alr_87013549 - here I can select by Projects and get the cost elements. I want to use this report as a base for my custom report, which should give me the same result as the above report with Project, WBS, Network activities for each line level..My questions are,
    1. Do I have to define my own library? with columns I need or use the library that the S_ALR report is in??
    2. I am having trouble in understanding characterics, key figure cocncepts - also info structures - to define a report with rows and columns like this - what shld i do>??
    Project name|WBSElement|Network Activity|NetworkActivityElement|CostElemt|PartnerObject|actualCOSt|PlanCost
    These columns should be there in my report...
    Finally - can i have more than 4 columns in my report??
    Please provide Expert advice....I will be really thankful...

  • I want to be able to write on my scanned document.

    I want to be able to write on my document that I have scanned  ,can you help?

    I want to type on a document that I have scanned ,How do i do that?

  • How to open and write to a new document from a filter plug in?

    Hi. I'm new to writing photoshop plug in. I would like to copy a small area of the current image, open a new document, and paste the area into the new document. All this is done in photoshop only.
    I am currently using the "Dissolve" filter to do my study, and i can't find the way to create a new document.
    I found a reply by Tom Ruark, mentioning using an automation plug in.
    Can someone please point out to me which functions, and parameters, to study?
    And are there any sample projects that do this?
    Many thanks.
    Regards,
    Yong

    You don't do that from a filter plugin. A filter plugin can only filter existing data.
    Yes, you would need a script or an automation plugin to create a new document.
    You might want to read the SDK about what the various types of plugins can do.

  • Can't write in Pages 09 documents with Mavericks

    So I accidentally upgraded to Pages 5 on my ipad so then I had to install Mavericks and Pages 5 on my MacBook too (to allow syncing). Now Pages 5 is a complete disaster. It screws up all the lay-outs I created in 09 and doesn't allow me to create new ones as there are simply too many features missing. For instance, where did the blue lines do that tell you when an object is exactly in the middle of a page?! And dozens more.
    Now, here's the thing. I was smart enough to save a copy of Pages 09, so I can still use that (even if it doesn't sync with my ipad). However, when I create a new document in Pages 09, there is no way to type in it anymore. As in, no cursor and no option to place it in the document. When I start typing, I get that annoying sound that indicates I'm trying to type somewhere that doesn't allow typing. Which is the main function of a word processing programme, so it's really weird!
    Any suggestions?!!! I actually use Pages now and then as a professional, using it to create lay-outs for a publisher. So I am really dependent on the programme. I am also happy to hear suggestions for a different word processor! I used to love Pages, but now I'm just miserable.

    I guess there is one positive note. The new IOS Pages exports to .docx format.
    I have Pages ’09 v4.3 installed and upgraded OS X 10.8.5 to Mavericks. I have not installed Pages v5.0. I can open a new document, type at will, and save it.
    Have you tried launching Pages ’09 from another account on your Mac? This will determine whether it is an installation issue, or a configuration issue unique to your login account. You may benefit from pressing shift+command+U and then launching Disk Utility to verify/repair permissions on your boot drive.

  • How to write program to make document well formed?

    hi All,
    I want to make the document well formed if it's not...
    Like if any tag is missing in the document that should be added programmatically.And the tags are generalized not hardcoded...
    Will u plz give me any idea for that....
    Plz help me.
    Thanks in advance

    There are two problems with this, and both are close to show-stoppers.
    1) What you showed is sloppy html. I'm not aware of any HTML parsers like are available for XML. If you use an XML parser, either DOM or SAX, you will stop with the first mismatched element. Once an XML parser recognizes the document is badly-formed, it stops. It might generate millions of phantom problems due to one missing element.
    2) Even if you could find that in your document stub there is a <para> element missing, so what. Where do you programmatically put the opening element? You would need to know a lot about what is allowed where to find the best place for it so it does the least damage to other elements.
    Dave Patterson

  • Can I read and write a Word/excel document on an iMac ?

    Will an iMac replace my existing non apple computer?

    Yes.
    You have a number of options -
    A new Mac comes with iWork for free - this includes Pages (Word Processor), Numbers (Spreadsheet) and Keynote (Presentation software) which will import and export Word and Excel files.  You MAY have some issues with formatting and recent version of iWork is rather cut-down.
    If you want maximum compatibility with Word and Excel, there are Mac versions to buy as downloads from Microsoft.
    Finally, there are a couple of rather good free Office suites - Open Office and Libre Office are both well thought of and will handle Word and Excel files - you cansearch for these via Google.
    Hope this helps.

  • 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'.

  • Pro grammatically generate build in document ID at the footer of Word document?

    Hi All,
    i am trying to added Document ID at the footer of Word file  programatically using the following code. Following code is working only when i am uploading the document first time and its adding the ID at the footer. But problem is when i am uploading
    same file into same document library, document Id is just going away. i have tried to use ItemUpdated method but it doesn't work. what i need to modify into code, so that same document ID will be remains at the footer of document no matter how many times uploaded
    document. any help will greatly appreciated. 
    using System;
    using System.Security.Permissions;
    using System.Runtime.InteropServices;
    using Microsoft.SharePoint;
    using System.IO;
    using System.IO.Packaging;
    using DocumentFormat.OpenXml.Packaging;
    using System.Xml;
    using System.Collections.Generic;
    using Microsoft.SharePoint.Security;
    using Microsoft.SharePoint.Utilities;
    using Microsoft.SharePoint.Workflow;
    namespace AddHeaderFooterReceiver.ItemAddedEventReceiver
        /// <summary>
        /// List Item Events
        /// </summary>
     public class ItemAddedEventReceiver : SPItemEventReceiver
            /// <summary>
            /// An item was added.
            /// </summary>
            public string GetFooter()
                string footerVal = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><w:ftr xmlns:ve=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"
    xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\"
    xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\"><w:p
    w:rsidR=\"00C24C70\" w:rsidRDefault=\"00C24C70\"><w:pPr><w:pStyle w:val=\"Footer\" /></w:pPr><w:r><w:t>Hi</w:t></w:r></w:p><w:p w:rsidR=\"00C24C70\" w:rsidRDefault=\"00C24C70\"><w:pPr><w:pStyle
    w:val=\"Footer\" /></w:pPr></w:p></w:ftr>";
                return footerVal;
            public void WDAddFooter(Stream footerContent, Stream fileContent)
                //  Given a document name, and a stream containing valid footer content,
                //  add the stream content as a footer in the document.
                const string documentRelationshipType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";
                const string wordmlNamespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
                const string footerContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml";
                const string footerRelationshipType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";
                const string relationshipNamespace = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
                PackagePart documentPart = null;
                using (Package wdPackage = Package.Open(fileContent, FileMode.Open, FileAccess.ReadWrite))
                    //  Get the main document part (document.xml).
                    foreach (System.IO.Packaging.PackageRelationship relationship in wdPackage.GetRelationshipsByType(documentRelationshipType))
                        Uri documentUri = PackUriHelper.ResolvePartUri(new Uri("/", UriKind.Relative), relationship.TargetUri);
                        documentPart = wdPackage.GetPart(documentUri);
                        //  There is only one officeDocument.
                        break;
                    Uri uriFooter = new Uri("/word/footer1.xml", UriKind.Relative);
                    if (wdPackage.PartExists(uriFooter))
                        //  Although you can delete the relationship
                        //  to the existing node, the next time you save
                        //  the document after making changes, Word
                        //  will delete the relationship.
                        wdPackage.DeletePart(uriFooter);
                    //  Create the footer part.
                    PackagePart footerPart = wdPackage.CreatePart(uriFooter, footerContentType);
                    //  Load the content from the input stream.
                    //  This may seem redundant, but you must read it at some point.
                    //  If you ever need to analyze the contents of the footer,
                    //  at least it is already in an XmlDocument.
                    //  This code uses the XmlDocument object only as
                    //  a "pass-through" -- giving it a place to hold as
                    //  it moves from the input stream to the output stream.
                    //  The code could read each byte from the input stream, and
                    //  write each byte to the output stream, but this seems
                    //  simpler...
                    XmlDocument footerDoc = new XmlDocument();
                    footerContent.Position = 0;
                    footerDoc.Load(footerContent);
                    //  Write the footer out to its part.
                    footerDoc.Save(footerPart.GetStream());
                    //  Create the document's relationship to the new part.
                    PackageRelationship rel = documentPart.CreateRelationship(uriFooter, TargetMode.Internal, footerRelationshipType);
                    string relID = rel.Id;
                    //  Manage namespaces to perform Xml XPath queries.
                    NameTable nt = new NameTable();
                    XmlNamespaceManager nsManager = new XmlNamespaceManager(nt);
                    nsManager.AddNamespace("w", wordmlNamespace);
                    //  Get the document part from the package.
                    //  Load the XML in the part into an XmlDocument instance.
                    XmlDocument xdoc = new XmlDocument(nt);
                    xdoc.Load(documentPart.GetStream());
                    //  Find the node containing the document layout.
                    XmlNode targetNode = xdoc.SelectSingleNode("//w:sectPr", nsManager);
                    if (targetNode != null)
                        //  Delete any existing references to footers.
                        //XmlNodeList footerNodes = targetNode.SelectNodes("./w:footerReference", nsManager);
                        //foreach (System.Xml.XmlNode footerNode in footerNodes)
                        //    targetNode.RemoveChild(footerNode);
                        //  Create the new footer reference node.
                        XmlElement node = xdoc.CreateElement("w:footerReference", wordmlNamespace);
                        XmlAttribute attr = node.Attributes.Append(xdoc.CreateAttribute("r:id", relationshipNamespace));
                        attr.Value = relID;
                        node.Attributes.Append(attr);
                        targetNode.InsertBefore(node, targetNode.FirstChild);
                    //  Save the document XML back to its part.
                    xdoc.Save(documentPart.GetStream(FileMode.Create, FileAccess.Write));
            public override void ItemAdded(SPItemEventProperties properties)
                string extension = properties.ListItem.Url.Substring(properties.ListItem.Url.LastIndexOf(".") + 1);
                if (extension == "docx")
                    //string headerContent = GetHeader().Replace("hello", properties.ListItem["Name"].ToString());
                    //string footerContent = GetFooter().Replace("Hi", properties.ListItem["Modified"].ToString());
                    //string footerContent = GetFooter().Replace("Hi", properties.ListItem["_dlc_DocId"].ToString() + "  V : " +properties.ListItem["_UIVersionString"].ToString());
                    string footerContent = GetFooter().Replace("Hi", properties.ListItem["_dlc_DocId"].ToString());
                    //string footerContent1 = GetFooter().Replace("Hi", properties.ListItem["_UIVersionString"].ToString());
                    //Stream headerStream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(headerContent));
                    //Stream footerStream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(footerContent));
                    Stream footerStream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(footerContent));
                    //Stream footerStream1 = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(footerContent1));
                    MemoryStream fileStream = new MemoryStream();
                    fileStream.Write(properties.ListItem.File.OpenBinary(), 0, (int)properties.ListItem.File.TotalLength);
                    //WDAddHeader(headerStream, fileStream);
                    //WDAddFooter(footerStream, fileStream);
                    WDAddFooter(footerStream, fileStream);
                    //WDAddFooter(footerStream1, fileStream);
                    properties.ListItem.File.SaveBinary(fileStream);

    Instead of using Event Receiver approach have you tried looking on adding labels instead?
    Here's a helpful article on how to add labels on your document
    http://blog.isaacblum.com/2011/02/28/add-document-id-to-word-document-automatically/
    Hope this helps
    Artificial intelligence can never beat natural stupidity.

  • How to write data on Ms word document

    Hai all,
    plz slove this problem.....
    while click the button open ms word document with data....
    how write data on word document...

    in languages like delphi, c++ you can do this with OLE automation. but im not kinda sure about OLE support in java.there could be API's for this. just try a search on the net.. Read through OLE automation.
    /Cheers,
    -MadGuy
    From Sri Lanka

Maybe you are looking for

  • Error while saving after changing the date of a parked invoice document in MIR7

    DUPREC:POS&INCOMINGINVOICE&(Invoice Number)(Fiscal Year) Message no. CD328

  • Context Menu Help

    Is there any way to reduce the number of items on the "open with" context menu? I have a lot of programs which can open files but I use only certain ones and would like to eliminate the others which show up. For instance, I have about 20 different di

  • Java Files API

    I have a J2EE application that allows a user to upload scanned documents from a web page. I then write them to a blob in an Oracle database. I would like to write them out to files and store the URL in the database. Is there and API for files for 9.0

  • PHP/MySQL list sorting

    I am working on a site that does reviews. On one of my pages I am needing to pull a list of my categories. However I only need one of each category. as you can see from the link below it currently is pulling everything from my category field includin

  • Where can I download I Movie for OS X 10.8.5?

    Hi, Where can I download I Movie for OS X 10.8.5 that is safe? Thanks Ted