none
multi-page add-in office.initialize RRS feed

  • Question

  • Hello

    I'm building a multi-page add-in. I got an working web app. But when I convert the web app to an office app. I can't print to text to my word-document. 

    I think it has to do with the office.initialize function. It says I have to place it on every page. But where do I have to place it? 

    In the head,body or another option for my html file? 

    When do I have to use app.initialize?

    Thank you very much,

    Kind regards, 

    Emiel Vanhaesebrouck

    Thursday, October 15, 2015 4:24 PM

Answers

  • >>>In the head,body or another option for my html file?

    The simplest Office Add-in for Excel 2013 or Word 2013 consists of a manifest XML file that points to a webpage or website.
    To implement this add-in, you need to create the following:
    •An HTML file that implements the UI of the add-in.
    •An XML manifest file that defines the metadata required to display and run the add-in in Word or Excel.
    •A CSS file to define a style sheet for the add-in.
    •A project.js file that contains JavaScript programming logic that can use the JavaScript API for Office (Office.js) to perform data access operations against the content in the Word or Excel document.

    <head>
            <meta charset="UTF-8" />
            <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
            <link rel="stylesheet" type="text/css" href="program.css" />
            <script src="https://appsforoffice.microsoft.com/lib/1/hosted/Office.js"></script>
            <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js"></script>
            <script src="Program.js"></script>
    </head>

    For more information, click here to refer about Create a task pane or content add-in for Word or Excel by using a text editor

    >>>When do I have to use app.initialize?
    You could refer to below code to use app.Initialize();

    Office.initialize = function (reason) {
            $(document).ready(function () {
                app.initialize();
                });
            });
    };

    For more information click here to refer about Understanding the JavaScript API for Office

    Monday, October 19, 2015 8:46 AM