Office Add-in: Word 2013 - InsertHTML not working - ms-word

We are trying to insert HTML in Word. It is working with 2016, but the add-in publish got rejected because it is not working in Word 2013. Not able to install 2013. Any help is appreciated. Here is our code:
Word.run(function (context) {
const range = context.document.getSelection();
range.insertHtml(richText, Word.InsertLocation.end);
return context.sync().then(function () {});
})

You need to use Requirement Sets to either specify in the manifest that the add-in is not supported on Office 2013, or use the isSetSupported method to give Office 2013 users an alternate experience of your add-in that does not use any APIs that are not supported on Office 2013. For more details, see Office versions and requirement sets and Specify Office hosts and API requirements.
UPDATE 4/10/20:
To ignore Office versions that do not support the APIs that you need, you need to find the earliest Requirement Set that includes the API. Since you are working with Word, you need to look at these 3 articles and find the earliest Requirement Set that includes the insertHtml method:
Word API 1.1 Requirement Set
Word API 1.2 Requirement Set
Word API 1.3 Requirement Set
After you've done that, follow the instructions in Set the Requirements element in the manifest to specify in your manifest the earliest requirement set that you need.

Related

Is there official clipboard access from office-js for Word add-in?

I have reviewed the office-js docs and not found any formal way of working with the clipboard through a Word add-in.
I attempted to use the newer navigator.clipboard.writeText but it is automatically rejected by the internal Word browser (where the add-in is hosted) without prompting the user (like a browser does). I have not seen any associated support for permissions policy that can be used to communicate with Word that the add-in would like clipboard permissions.
So, I am resorting to the deprecated document.executeCommand('copy') for now, but am concerned that will get my add-in rejected by the MS App Store.
Is there an official/sanctioned way to use the clipboard from within a MS Word add-in?
OfficeJS doesn't provide anything for that. You may sill use the Document.execCommand() API which includes "copy", "cut" and "paste". But it was deprecated and may not work in the web browsers any longer.
Feature requests on Tech Community are considered, when the dev team go through the planning process. Use the github label: Type: product feature request at https://aka.ms/M365dev-suggestions .
It seems like there's one method Range.copyFrom of Excel rich client api. I can't find the alternatives either. Maybe you can ask to provide the new feature. Whether it could be in the future feature list or not may also take some time.

Microsoft Team - Create new team with predefine language for underlying SharePoint site

Our Microsoft 365 is configured with Danish as default language, as a consequence is the language of all SharePoint team sites that are automatically created by Microsoft 365 when creating a new team also using Danish. This is a problem because the document library is using https://foobar.sharepoint.com/sites/test/Delte%20dokumenter/Forms/AllItems.aspx instead of https://foobar.sharepoint.com/sites/test/Shared%20Documents/Forms/AllItems.aspx as URL.
I am now trying to find a way to create multiple teams (50+) where the language of the SPO site is English instead of Danish.
I have already tried the following concepts without success
Approach 1: Use a team-template when creating a new team, the language defined by the template does not affect the language of the SPO site.
Approach 2: Creating unified group first and than convert unified-group into team: The language of cmdlet New-UnifiedGroup does not affect the language of the SPO site
Approach 3: Create SPO site with PowerShell first and than create team based on this site. A similar concept is covered in blog article
Create a Team From Existing SharePoint Online Modern Team Site Using PowerShell, but the problem is the fact that I cannot create a group-enabled team-site using PowerShell, when using template STS#3 - the attempt to create a new SPO site using template GROUP#0 results in error (The web template GROUP#0 is not available for sites on this tenant)
Ok, I found a solution: Use the cmdlet Set-SPOSiteOffice365Group
My approach includes now the following step:
Create a SPO team site with PowerShell (not related to a unified group). Defined the correct /needed language via parameter LocaleId.
Use Set-SPOSiteOffice365Group - this will create a new unified group and that will use the exiting SPO team-site
Convert the unified group into team, see Creating a New Microsoft 365 Group with the Microsoft PowerShell Graph SDK

Microsoft WORD add-in generated by generator-office can not load Office object

I have not enough reputation to post pictures, you can see the similar question here: https://learn.microsoft.com/en-us/answers/questions/392363/word-add-in-generated-by-generator-office-can-not.html
According to the Microsoft official Office documentation, I tried to use Yeoman's generator-office to generate WORD add-in, and then use npm start to start, but in the Taskpane it always showed "Please sideload your add-in to see app body".
Using the Microsoft Edge DevTools Preview tool, I can see the missing Office objects.So this question has something to do with the version?
But when I visited this add-in via the web page, I can see that the Office object is loaded successfully.
Why is the Office object unsuccessful when accessing this add-in in WORD,and how can I fix this?
Recorded following on May 19th. I tried to executed this example on another computer with Win7 and Office Professional 2016,it works well.
I tried the Office 2019 Professional,this problem is solved. I don't know it's the problem of edition, or of activation.

Can you add validation to VSO/VSTS Work Item fields?

I was just trying to work out if it was possible to add validation to Work Item fields in Visual Studio Online / Team Services.
My use case is i want to make some fields mandatory if a certain condition is met (e.g. if Field1 = x then Field2 cannot be blank)
There isn't any way to do this. To achieve this feature, you need to customize the process template and work item definition which is not supported by VSTS for now.
There is already a feature request for this on VSTS User Voice: Customize Process Template on Visual Studio Online and MS keeps working on this. Refer to this link for details: VSTS Process Customization futures (January 2016)

Update metadata of MOSS document library item using powershell

Is it possible to update metadata of an item in SharePoint 2007 document library using powershell?
I'd like to execute a CAML query and then change && update every item in the results list. My goal is to write a single throwaway script instead of writing a console app in VS. Can anyone point me towards a way of doing this?
Thanks,
josko
I'm normally able to do anything in sharepoint 2010 just using Powershell and:
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Sharepoint")
But never tried in Sharepoint 2007. However I think you won't have any problem, since it seems Sharepoint Services 3.0 supports the assembly as well, along with SPQuery
Yes you can update document library item using powershell.
please refer site :
http://www.powershell.nu/2009/09/08/moss-2007-script-collection/
Refer these examples given here.