Word Web Add-in - Alignment of Footer content

1

Hello

I'm developing an add-in for Word, following the template in visual studio.

Today, with the following code, I have the result almost finished. However, in Footer, I can not at all (of which I have already tried and researched) to align this blessed text to the right.

In addition, as you can see, there is an image in the header, this image is not displaying in 100% width because the page has a margin. I would like it to be 100% wide in the Header. How could I?

  

Code:

Word.run(function (context) {
    var mySections = context.document.sections;

    context.load(mySections, 'body/style');

    return context.sync().then(function () {

        var myHeader = mySections.items[0].getHeader("primary");
        myHeader.clear();


        myHeader.insertInlinePictureFromBase64(imgHeader, Word.InsertLocation.start);
        myHeader.insertContentControl();


        var myFooter = mySections.items[0].getFooter("primary");
        myFooter.clear();

        myFooter.insertHtml("<p align='right'>São Paulo ∙ Brasília</p><p align='right'>www.google.com.br</p >", Word.InsertLocation.start);
        myFooter.insertContentControl();

        return context.sync().then(function () {
            console.log("Added a header for the first section.");
            console.log("Added a footer for the first section.");
        });

    });
})
    .catch(function (err) {
        console.log('Error: ' + JSON.stringify(err));
        if (error instanceof OfficeExtension.Error) {
            console.log("Debug Info: " + JSON.stringify(err.debugInfo()));
        }
    });
  

Image result:

     

Header generated with the above code

    
asked by anonymous 29.10.2018 / 21:35

0 answers