Giter VIP home page Giter VIP logo

office-addin-taskpane-react-js's Introduction

Office-Addin-TaskPane-React-JS

This repository contains the source code used by the Yo Office generator when you create a new Office Add-in that appears in the task pane. You can also use this repository as a sample to base your own project from if you choose not to use the generator.

JavaScript

This template is written using JavaScript. For the TypeScript version of this template, go to Office-Addin-TaskPane-React.

Debugging

This template supports debugging using any of the following techniques:

Questions and comments

We'd love to get your feedback about this sample. You can send your feedback to us in the Issues section of this repository.

Questions about Office Add-ins development in general should be posted to Microsoft Q&A. If your question is about the Office JavaScript APIs, make sure it's tagged with [office-js-dev].

Join the Microsoft 365 Developer Program

Join the Microsoft 365 Developer Program to get resources and information to help you build solutions for the Microsoft 365 platform, including recommendations tailored to your areas of interest.

You might also qualify for a free developer subscription that's renewable for 90 days and comes configured with sample data; for details, see the FAQ.

Additional resources

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Copyright

Copyright (c) 2021 Microsoft Corporation. All rights reserved.

office-addin-taskpane-react-js's People

Contributors

akrantz avatar davidchesnut avatar dependabot[bot] avatar donaldgu avatar elizabethsamuel-msft avatar hermanwenhe avatar igor-ribeiiro avatar lindalu-msft avatar lovesponge avatar michieldemey avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar millerds avatar msftgits avatar nokafor avatar quanfuxiao avatar rick-kirkham avatar rob-deutsch avatar tcourtneyowen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

office-addin-taskpane-react-js's Issues

SecurityError with websockets

I'm getting a very ambiguous error when trying to connect to my websocket server

Error: SecurityError

I've searched multiple places - stackoverflow has tons of office-js questions and 0 answers. Can anyone point me in the right direction to sovle this issue? Can i just disable security and bypass this?

Outlook Add In works in local dev, not in production

Okay so I used yeo generator for react to make outlook add in.
local development works awesome.

I have a developer 365 account desktop Mac version of Outlook, can login in also to web version.

To test the add in with other team mates who are not developers or have a dev setup I added accounts in my office 365 so they can have access.
I did an npm run build and put the dist folder on my https://mydomain.com/dist and my manifest.prod.xml reflects that
the domain is on shared hosting but figure that doesn't matter as its a bundled up app with everything included

I went into admin center of office 365 -> integrated apps upload custom app ... filled out input with
"https://mydomain.com/dist/manifest.prod.xml" .. it validated and said can take upto 6 hours to show in app.

It eventually showed up ... now when I open it from desktop Outlook the sidebar opens has name at top and the Loading spinner goes for a second then disappears but sidebar stays blank , Inspecting ..safari opens I see
Screen Shot 2021-04-20 at 5 00 51 PM

also Network tab shows it get all the files in from https://mydomain.com/dist without error, react and any libraries are bundled in taskpane.js as they should be

It just seems that when office ready the app isn't loading in?

Not sure what next steps to take to diagnose.. sprinkle console.logs here and there change manifest version re build re upload wait for it to refresh in outlook try check logs try again?

EDIT console.logs are omitted in prod build it seems

Looking for instructions on how to dockerize the app

Hi,

I have been trying to dockerize the app without much success. Since I don't have much experience on ReactJS webpack apps I was hoping you would have some instructions on how to do it for this project in particular.

Thanks in advance.

React Router

I was trying to implement react-router-dom the same as I do in normal react js web page in Office-Addin-TaskPane-React-JS but it does not work, is it possible to implement routes?

Word insertParagraph is not working addin on Mac - only from Developer Window

Expected behavior

I am expecting to have text inserted using my dialog. I have spent literally hours and it drives me mad.

Current behavior

The current behaviour works ONLY from the developer window - WHICH USES THE same code than the DIALOG WINDOW

Steps to Reproduce

  1. Manifest
  2. defaults write com.microsoft.Word OfficeWebAddinDeveloperExtras -bool true
  3. npm run dev-server and npm run dev in separate window

Context

  • Operating System: Mac OS Big Sur
  • Node version: v16.13.2
Bug.Developer.Window.mov
  • Office version: 16.57
  • Tool version: VS Code 1.63.2
let count = 0
export async function writeToWordImpl (text) {
    return Word.run(async context => {
        count = count +1
        let text_ = text  + count.toString()
        console.log("Writing Word:", text_)
        var body = context.document.body;
        console.log("Writing Word - BODY:", text_)
        // Queue a command to insert the paragraph at the end of the document body.
        try{
            console.log("Writing Word - B4 TRY:", text_)
            body.insertParagraph(text_, Word.InsertLocation.end)
            console.log("Writing Word - SHOULD HAVE INSERTED OK:", text_ )
        }
        catch(error) {
            //never printed
            console.log("Writing Word - CATCH:", error)
        }
        console.log("Writing Word - SHOULD HAVE INSERTED OK 2:", text_)
        // body.insertParagraph('Content of a new paragraph', Word.InsertLocation.end)
        // Synchronize the document state by executing the queued commands,
        // and return a promise to indicate task completion.
        await context.sync().then(function () {
            console.log('Paragraph added at the end of the document body.');
        })
        .catch(function (error) {
            //never printed
            console.log('Error sync paragragh: ', error);
        })
        console.log("Writing to Word 8 - SYNC:", text)
    })
    .catch(function (error) {
        //never printed
        console.log('Error insert paragragh: ', error);
    })
}

Update class components to functional components

Although the React version is 17~, the current template uses class-components.
I think it may help to update the template to use functional class components and hooks, especially for new-comers to office add-ins and react post-class components.

I would be willing to open a PR for this update.

React Hooks samples?

Hi,

Was wondering if we could eventually get some samples for react hooks? Particularly, react hooks with event listeners if at all possible.

Thanks!

Task pane has some text that shouldn't be there.

Expected behavior

Mistaken instructions should not be in the task pane.

Current behavior

The task pane contains the line "Modify the source files, then click Run." But this add-in doesn't have a Run button. It has a button with a different label.
image

Steps to Reproduce

Run the add-in.

Is there an api/programmatic way to update TaskPane cache?

HI, I found that TaskPane Add in cache is inside
C:\Users\USERNAME\AppData\Local\Microsoft\Office\16.0\Wef\AppCommands, I can only update it by clicking at my addin tab(take excel for example) and select the addin then click 'add'.

Is there an api/programmatic way to update the cache? I tried with Marco but seems it can only deal with the automation add-ins instead of the web add-in

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.