office-js | NPM package for Office.js , corresponding to a copy | Email library

 by   OfficeDev JavaScript Version: v1.1.10 License: Non-SPDX

kandi X-RAY | office-js Summary

kandi X-RAY | office-js Summary

office-js is a JavaScript library typically used in Messaging, Email, Nodejs applications. office-js has no bugs, it has no vulnerabilities and it has medium support. However office-js has a Non-SPDX License. You can download it from GitHub.

The NPM package for Office.js is a copy of what gets published to the official "evergreen" Office.js CDN, at The Office.js CDN contains all currently available Office.js APIs at any moment in time. Each Office.js NPM package contains only Office.js APIs available on the Office.js CDN when the NPM package version was created.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              office-js has a medium active ecosystem.
              It has 539 star(s) with 88 fork(s). There are 277 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 900 open issues and 2388 have been closed. On average issues are closed in 123 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of office-js is v1.1.10

            kandi-Quality Quality

              office-js has 0 bugs and 0 code smells.

            kandi-Security Security

              office-js has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              office-js code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              office-js has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              office-js releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of office-js
            Get all kandi verified functions for this library.

            office-js Key Features

            No Key Features are available at this moment for office-js.

            office-js Examples and Code Snippets

            No Code Snippets are available at this moment for office-js.

            Community Discussions

            QUESTION

            Outlook Web Add-In - Office-JS - Sort Incoming E-Mail
            Asked 2022-Mar-24 at 18:01

            I've got a macro for sorting my incoming e-mail that I considered converting to Office-JS. I just saw this SO post and the answer stated --

            Outlook web add-ins work under the context of currently selected item only

            Does that mean my idea of an Add-In that sorts e-mail is unfeasible currently? Can I make an Add-In that constantly runs and redirects incoming e-mails?

            ...

            ANSWER

            Answered 2022-Mar-24 at 08:10

            You can run add-in(s) only on a particular item(mail/calendar event). The Add-in framework does not support a trigger based on the incoming emails.

            Source https://stackoverflow.com/questions/71594958

            QUESTION

            What is the EWS SOAP XML code to get ICalUid?
            Asked 2022-Mar-22 at 09:40

            We're using Office JS to develop an Addin for Outlook Calendar. For the same appointment, the EWS Ids of the Organizer and Attendees do not match. Apparently I need ICalUid from Exchange which is common across organizer and attendees and common across different events for the same Item, exactly what we need. But Office JS does not provide such property nor method to fetch it (only for .NET).

            But Office JS provides Office.context.mailbox.makeEwsRequestAsync with which I can make SOAP requests to the Exchange server, using XML.

            What is the EWS SOAP XML code to get ICalUid from EWS Id?

            Does this work? Just replacing FieldURI with ICalUid?

            ...

            ANSWER

            Answered 2022-Mar-21 at 14:30

            For the IcalUid you would need

            Source https://stackoverflow.com/questions/71539113

            QUESTION

            Total Rows and Columns Count - Excel Office JS
            Asked 2022-Mar-21 at 00:47

            I've been using getRangeByIndexes as it seems to be the best way to use numbers to get Ranges in Office-JS. Problem I'm having is that when I need to use entire row/columns, I've resorted to the below. I read up and looks like number of rows/cols hasn't changed in a long time, but I know in vba I used rows.count to make sure the code was dynamic, whatever version of Excel it would use the number of rows on a spreadsheet.

            Is there anything similar in Office-JS?

            ...

            ANSWER

            Answered 2022-Mar-21 at 00:47

            This will do it for you ...

            Source https://stackoverflow.com/questions/71551499

            QUESTION

            Office-JS API with Fetch to get data from server, replace fields in Word - ItemNotFound error
            Asked 2022-Mar-16 at 19:35

            I am new to the Office-JS API, but trying to develop a POC to demonstrate the ability to, with the click of a button, replace all fields in a Word document with corresponding data retrieved from an API.

            So I have developed an API as an Azure Function, which I can call, passing a value, and it will return the field names and values as JSON for the record that matches the passed value. I have tested this already using Postman.

            Now I am trying to get the Office-JS piece working. I started with the VS-2022 template, which I have converted to TypeScript.

            My intended approach is that when the user clicks the button, the application will call the API and obtain the record (data) fields as a set of name/value pairs.

            Then, I want loop through all of the (data) fields returned, and for each (data) field name, check to see if there is a (document) field in the document by that name; if so, replace the (document) field with the (data) field's value.

            This code is successfully finding the search criteria, and queueing up the replacements, in preparation for the context.sync call... But then during the context.sync call, is reporting an error "ItemNotFound."

            I am following the recommended approach documented here https://docs.microsoft.com/en-us/office/dev/add-ins/concepts/correlated-objects-pattern under the "Process objects in the document with the correlated objects pattern" section.

            My code follows:

            ...

            ANSWER

            Answered 2022-Mar-16 at 19:35

            This all, ultimately, turned out to be caused by lack of a single await... Note the line below with the FETCH statement, which previously did not have an AWAIT before it.

            Source https://stackoverflow.com/questions/71424151

            QUESTION

            Office-JS API with Fetch to get data from server, replace fields in Word
            Asked 2022-Mar-09 at 23:02

            I am new to the Office-JS API, but trying to develop a POC to demonstrate the ability to, with the click of a button, replace all fields in a Word document with corresponding data retrieved from an API.

            So I have developed an API as an Azure Function, which I can call, passing a value, and it will return the field names and values as JSON for the record that matches the passed value. I have tested this already using Postman.

            Now I am trying to get the Office-JS piece working. I started with the VS-2022 template.

            My intended approach is that when the user clicks the button, the application will call the API and obtain the record (data) fields as a set of name/value pairs.

            Then, I want loop through all of the (data) fields returned, and for each (data) field name, check to see if there is a (document) field in the document by that name; if so, replace the (document) field with the (data) field's value.

            In the end, I realize it would likely be more efficient to loop the other way (loop through the doc fields, and then get the (data) field's value, etc.), but I figure I can tweak this once I get it working.

            I also realize it's bad practice to perform a context.sync() within a loop, but again - I can clean that up once I get it working.

            Right now, my code is reporting "Error: InvalidRequestContext: Cannot use the object across different request contexts."

            My code follows:

            ...

            ANSWER

            Answered 2022-Mar-09 at 23:02

            This is another common symptom of nested calls of context.sync. Fix the nesting first. Also, performance is better when you push filtering logic as close to the data source as possible. Consider designing the Azure Function to take in a list of fields and send back only data for matching names. Then your client side code is greatly simplified because you can assume there is a matching field for every data record that is returned.

            Source https://stackoverflow.com/questions/71414777

            QUESTION

            Excel.run, pass and return context as a variable, where does context come from?
            Asked 2022-Mar-07 at 19:00

            I have a big Google Apps Script project working on Google Spreadsheets and I am trying to convert it to an office-js add-in that works on Excel Workbooks. I understand that it is good practice to put everything that will be calling excel specific functions (directly interacting with the workbook) into an Excel.run() function so it does a proper clean-up and no memory leaks occur. I also understand I should do context.sync() as little as possible to optimize performance.

            Here are my questions, (I think some of them come from my incomplete grasp of how js works; these things GAS handled without me needing to question them) :

            1a) When we put our block of code in

            ...

            ANSWER

            Answered 2022-Mar-04 at 00:17

            I'll try to answer some of these questions and try to get some help for the others. I also recommend the book Building Office Add-ins for an understanding of the Office JavaScript library. See this too, if you haven't already: Application specific API model.

            1a. Yes. That's essentially correct. Under the hood, Excel.run creates an Office.RequestContext object and passes it to the batch function parameter. (But your two code blocks are not literally equivalent. You would not call Excel.run AND explicitly create a RequestContext object.)

            1b. From skimming the book I linked to, I think that you have to return what the book calls the meta-promise so that the Excel.run can resolve the Promise that it returns. Here's an example from the book:

            Source https://stackoverflow.com/questions/71335482

            QUESTION

            Can an Office Add-in run without Edge/IE installed?
            Asked 2022-Mar-03 at 05:50

            We have a client that wants to run our Excel Add-in (web-based Office Add-in written with office-js), however, they don't have Edge or IE installed. They are running Version 2008 (Build 13127.21766) of Excel, which according to the documentation from Microsoft uses the EdgeHTML WebView (Edge Legacy)

            I know with the WebView2 runtimes you can install the runtime separately since Windows 8.1 and 10 didn't come with that runtime. Can the same process be followed for the EdgeHTML WebView (Edge Legacy), as in can we install an EdgeHTML WebView runtime while not having Edge installed? If so can someone point me in the right direction on where to get this runtime from?

            ...

            ANSWER

            Answered 2022-Mar-02 at 20:05

            The only way to get the EdgeHTML webview installed is to install Edge.

            Source https://stackoverflow.com/questions/71319719

            QUESTION

            Apply Conditional Formatting - Duplicates - Excel Javascript
            Asked 2022-Mar-02 at 23:31

            I'm trying to add Conditional Highlighting to a column in Excel via Office-JS. I used the automate feature for the first time, but I can't seem to get it to work in Excel.

            This is what automate spat out:

            ...

            ANSWER

            Answered 2022-Feb-22 at 02:28

            You can use ConditionalFormatPresetCriterion to do this. Please see the example below:

            Source https://stackoverflow.com/questions/71189904

            QUESTION

            Outlook Add-In: how to automatically reply based on custom logic?
            Asked 2022-Feb-04 at 17:23
            Question

            Is it possible with an Outlook add-in to automatically reply only to certain emails/senders, based on custom logic? If so, how?

            Examples

            Such an add-in might send an automatic reply only to senders not in contacts, or only to senders whose email has been verified by an external service (which the add-in calls to check). This automatic reply might be:

            Thanks for your email! I prioritize emails from verified senders. You can verify yourself for free here.

            The sender who receives that message could then click the link and verify through the external service. Then, for future emails, the automatic reply would NOT apply to that sender.

            Background

            Outlook has an automatic reply option in settings, but its functionality is limited to setting a specific message for internal senders and a different one for external senders, plus choosing whether to only use the automatic reply with contacts. There's no built in ability to accomplish what's described in the examples above.

            Other Questions and Answers (Possibly Relevant)

            Any help would be very much appreciated!

            ...

            ANSWER

            Answered 2022-Feb-03 at 21:38

            Outlook web add-ins are designed for running for the currently selected item. So, the user should select a particular item in Outlook to activate the add-in. Unlike VSTO where you could handle incoming emails by handling the NewMailEx event of the Application class.

            The NewMailEx event fires when a new message arrives in the Inbox and before client rule processing occurs. Use the Entry ID returned in the EntryIDCollection string to call the NameSpace.GetItemFromID method and process the item. This event fires once for every received item that is processed by Microsoft Outlook. The item can be one of several different item types, for example, MailItem, MeetingItem, or SharingItem.

            As soon as you have got an instance of the incoming email you can use the MailItem.Reply method which creates a reply, pre-addressed to the original sender, from the original message.

            Finally, you may find the following articles helpful:

            Source https://stackoverflow.com/questions/70977856

            QUESTION

            Module not found: Can't resolve 'color'
            Asked 2022-Jan-14 at 10:32

            I have the following package.json for my React project.

            ...

            ANSWER

            Answered 2022-Jan-14 at 10:32

            If you are using color package, make sure that you are importing the package on theme.tsx

            Source https://stackoverflow.com/questions/70709162

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install office-js

            To install "office-js" locally via the NPM package, run the following command:. npm install @microsoft/office-js --save. Our policy requires that developers always reference the latest version of Office.js library. This is to ensure that essential product updates are served quickly to the Office Add-ins by always referencing the latest release of the library for a given version, such as Generally Available (GA) version. Given that the latest Office.js release is backward-compatible with prior releases, it is safe to update to the most recent release of the library when one is available. Hence, only the latest version of Office.js NPM package is made available for installation.

            Support

            The Office.js CDN is the official supported source for Office Add-ins. For the NPM package sourced through this repository, only the latest version of the package is supported. No support and no patches will be provided for previous versions of the package. The frequency of the updates to this repository and related NPM package to match the CDN version is not guaranteed. Outlook add-ins do not support hosting Office.js offline due to network access requirements for dependencies like the Microsoft Ajax library.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/OfficeDev/office-js.git

          • CLI

            gh repo clone OfficeDev/office-js

          • sshUrl

            git@github.com:OfficeDev/office-js.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Email Libraries

            PHPMailer

            by PHPMailer

            nodemailer

            by nodemailer

            mjml

            by mjmlio

            Mailspring

            by Foundry376

            postal

            by postalserver

            Try Top Libraries by OfficeDev

            Open-XML-SDK

            by OfficeDevC#

            TrainingContent

            by OfficeDevC#

            ews-java-api

            by OfficeDevJava

            generator-office

            by OfficeDevTypeScript

            Open-Xml-PowerTools

            by OfficeDevC#