Auto load Office Centralized deployed custom Add-in using upload XML manifest file - web

I have created a customized add-in to PowerPoint and I deployed that through Centralized Deployment using upload manifest file in the Office 365 admin center.
I want this add-in to be loaded automatically when the user opens a document, for this I was used Open XML SDK to configure Office documents to automatically open a specified add-in
https://github.com/OfficeDev/Office-OOXML-EmbedAddin
But currently, I am not able to load it automatically. I am getting an error "Add-in Warning This add-in is no longer available."
.
I have mentioned two lines of code used in the program , here we used two ids for webextension and WebExtensionStoreReference.
please advice on these two lines to what parameter and values I want to use correctly
We.WebExtension webExtension1 = new We.WebExtension(){ Id = "{52811C31-4593-43B8-A697-EB873422D156}" };
We.WebExtensionStoreReference webExtensionStoreReference1 = new We.WebExtensionStoreReference() { Id = "af8fa5ba-4010-4bcc-9e03-a91ddadf6dd3", Version = "1.0.0.0", Store = "EXCatalog", StoreType = "EXCatalog" };
please help if anyone knows about this....!!

Related

(-2147024891, 'Access is denied.', None, None)

I am developing a Django (v 3.2.6) application (Python 3.9.1.) which needs to write into an Excel file using pywin32.com.
On the client side it works fine, but when I put in production using IIS (v 10) on a Windows 11 server, I get the error above.
I have a routine that reads in a file input by the user and writes to the project directory:
if request.method == 'POST':
# Create a form instance and populate it with the file from the request (binding):
form = Name1_uploadForm(request.POST, request.FILES)
if form.is_valid():
# Create variable for uploaded file
uploaded_excel_file = form.cleaned_data['excel_file']
# Write it to BASE_DIR
with open(os.path.join(settings.BASE_DIR, form.cleaned_data['excel_file'].name), 'wb+') as destination:
for chunk in uploaded_excel_file.chunks():
destination.write(chunk)
# Allow the write process to conclude
time.sleep(12)
# Close the file
destination.close()
# Call conversion function
Name1_extraction(os.path.join(settings.BASE_DIR, form.cleaned_data['excel_file'].name))
# redirect to a new URL:
return HttpResponseRedirect(reverse('index') )
else:
form = Name1_uploadForm()
This calls another function (below) that should open that same file:
def Name1_extraction(uploaded_excel_file):
const = win32.constants
# Need to run CoInitialize to use win32com.client
pythoncom.CoInitialize()
# Open Name1 excel with Win32com
excelFile = win32.gencache.EnsureDispatch('Excel.Application')
The complete error is the following:
enter image description here
enter image description here
enter image description here
The error occurs when the following line of code is executed:
excelFile = win32.gencache.EnsureDispatch('Excel.Application')
The application pool is IIS AppPool\DefaultAppPool.
DefaultAppPool has been granted full access to folders C:\Windows\SysWOW64\config\systemprofile\Desktop and C:\Windows\System32\config\systemprofile\Desktop
With these actions I would not expect to see any errors
Thank you for any help provided.
Microsoft does not recommend or support server-side Automation of Office, and Microsoft strongly recommends that developers look for alternatives to Automation of Office when they need to develop server-side solutions.
Due to limitations in the design of Office, changing the Office configuration alone is not sufficient to resolve all issues. Microsoft strongly recommends some alternatives that don't require a server-side installation of Office and can perform most common tasks more efficiently and faster than Automation.
Most server-side automation tasks involve document creation or editing. Office 2007 supports the new Open XML file format, which allows developers to create, edit, read, and transform file content on the server side. This is the recommended and supported method of handling changes to Office files from the service.
How to use the Open XML SDK 2.5 for Office, please refer to the Microsoft documentation:
https://learn.microsoft.com/en-us/office/open-xml/open-xml-sdk
Considerations for server-side Automation of Office, please refer to this Microsoft blog:
https://support.microsoft.com/en-us/topic/considerations-for-server-side-automation-of-office-48bcfe93-8a89-47f1-0bce-017433ad79e2
I've had a similar problem:
I had a Python program with the xlwings library and I created a .bat file.
When I launched it by hand it worked perfectly, but with Windows 10 Scheduler I received an error "(-2147024891, 'Access denied.', None, None)".
I carried out the automatic correction of the Excel file which can be done by going to Excel > File > Info > Verify document.
My problem was that the Windows Scheduler didn't accept comments in the .xlsm file.
I deleted all the comments and then the Windows Scheduler started

How can I open a Word document from within Power Apps running in Teams?

I have created a Power Apps application that runs within a MS Teams channel.
The app lists a number of MS Office documents located in a master SharePoint library.
When a document is clicked the app copies the document from the master SharePoint library across to the local Teams Channel Files library.
Anyone know how I can automate the open of the document that now lives in the MS Teams channel Files library?
-- Edit --
I'm using Power Automate to copy the file between the SharePoint libraries. Power Automate returns the destination file path. Unfortunately If I Launch() that url, the file is downloaded - Not opened.
You can use deeplink to automate. You can generate a deeplink to your file and automate. Here is a sample format for deeplink to files -
https://teams.microsoft.com/l/file/5E0154FC-F2B4-4DA5-8CDA-F096E72C0A80?tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47&fileType=pptx&objectUrl=https%3A%2F%2Fmicrosoft.sharepoint.com%2Fteams%2FActionPlatform%2FShared%20Documents%2FFC7-%20Bot%20and%20Action%20Infra%2FKaizala%20Actions%20in%20Adaptive%20Cards%20-%20Deck.pptx&baseUrl=https%3A%2F%2Fmicrosoft.sharepoint.com%2Fteams%2FActionPlatform&serviceName=teams&threadId=19:f8fbfc4d89e24ef5b3b8692538cebeb7#thread.skype&groupId=ae063b79-5315-4ddb-ba70-27328ba6c31e.
This is the serialization of this object:
{
tenantId: “72f988bf-86f1-41af-91ab-2d7cd011db47”,
filetype: = “pptx”,
objectUrl: “https://microsoft.sharepoint.com/teams/ActionPlatform/Shared Documents/FC7- Bot and Action Infra/Kaizala Actions in Adaptive Cards - Deck.pptx”,
baseUrl: “https://microsoft.sharepoint.com/teams/ActionPlatform”,
serviceName: “teams”,
threadId: = “19:f8fbfc4d89e24ef5b3b8692538cebeb7#thread.skype”,
groupId: “ae063b79-5315-4ddb-ba70-27328ba6c31e”
}

Issue while Instantiating SharePoint 2010 method in MSCRM 2011 plug-in

This is regarding SharePoint 2010 Integration with MSCRM 2011.
While creating a record in CRM, trying to create a Custom Document location for that record and a similar folder in sharepoint, So that when user clicks on document link in the entity record it does not prompt user to create folder in Sharpoint (Trying to avoid sharepoint noise for better user experience)
I have implemented through post create asynchronous plug-in. (I did this through console program working fine). Build the plugenter code here-in and deployed to CRM.
When creating a record it error out with a message like "An internal server 500 error - Could not load the assembly with public key token etc…blab bla bla…”
But when I am debugging the plug-in it failed at the first line of command where I am instantiating sharePoint method Create client context of sharepoint, it says [System.Security.SecurityException]={“That assembly does not allow partially trusted callers”.}
As per google, per this issue it should be having one attribute “Allow partial users” in assembly info file. As per my understanding, this should be done in because the request goes from CRM plug-in to SharePoint dll. I mean share point dlls are not allowing request from my assembly. How can we change that?
I have referenced Microsoft.SharePoint.client.dll and Microsoft.SharePoint.Client.Runtime.dll
What is the alternate to overcome this issue?
Appreciate if some one can help me ..Thanks In advance.
Here is my code for SharePoint
ClientContext clientContext = new ClientContext(siteUrl)
CredentialCache cc = new CredentialCache();
Cc.Add(new Uri(siteUrl), "NTLM", CredentialCache.DefaultNetworkCredentials);
clientContext.Credentials = cc;
clientContext.AuthenticationMode = ClientAuthenticationMode.Default;
Web web = clientContext.Web;
SP.List list = web.Lists.GetByTitle(listName);
ListItemCreationInformation newItem = new ListItemCreationInformation();
newItem.UnderlyingObjectType = FileSystemObjectType.Folder;
newItem.FolderUrl = siteUrl + "/" + folderlogicalName;
if (!relativePath.Equals(string.Empty))
newItem.FolderUrl += "/" + relativePath;
newItem.LeafName = newfolderName;
SP.ListItem item = list.AddItem(newItem);
item.Update();
clientContext.ExecuteQuery();
Where I am passing the siteurl, folderlogicalname,relativepath and new foldername as parameters.
This works fine from my Console application. But when converted to CRM plug-in it gives the above specified issue
I've seen a similar issue before.
CRM plugins run inside a sandbox, so all assemblies and .NET libraries used must allow partial trust callers (since the CRM sandbox runs under partial trust). It works in the console because you are executing the code as a full trust user in that context.
This issue is not necessarily your code, but could be a dependency or a .NET library itself does not allow partial trust callers - in your case it sounds like the Sharepoint library is the culprit (but a stack trace of the error should reveal exactly where the cause is).
Since you don't have access to the source library causing the problem, to overcome the error you will likely have to create a wrapper. However, the problem is the wrapper cannot directly reference the problem library or you will get the same issue. So to get around this, you may have to create a web service which acts as your wrapper and then call the web service in your CRM plugin. This way the full trust code is executed by the web service (which is full trust) and then returns the result to your calling CRM plugin.
Here is more info on the error.
Thanks Jason. This works for me.
I Would like to add additional few points to the answer.
1. I have added the sharepoint dlls to the bin folder of CRM 2011 site.
2. Also deployed the same dlls in the folder whereever Async job is running to make my Async plug-in to work.
Thanks once again for the cooperation

How can you read the fields from a password-protected PDF using iText when you do have the PDF password?

I have a PDF created from LiveCycle Designer in PDF 1.7.
I'd like to read some fields in that PDF on the server side at times. I have the password that protects the PDF on the server side.
I am able to use iText for this for non-encrypted PDFs just fine...
PdfReader reader = new PdfReader(request.getInputStream());
AcroFields af = reader.getAcroFields();
Map<String, AcroFields.Item> afFields = af.getFields();
for (String key : afFields.keySet()) {
System.out.print(key + " = ");
System.out.println(af.getField(key));
}
But when I do that same thing for a PDF that is password protected, this seems to break down. I get no fields returned.
Is there some way I can send that password into iText and be able to read the fields?
I also have access to the LiveCycle ES3 SDK as well. Maybe they provide an API to do that?
The answer, in case anyone was seeking for it, was to abandon the use of iText when trying to read data from a LiveCycle created PDF from your java app. I was so used to using Open Source APIs, I forgot to utilize the LiveCycle Web Services that they provided.
They provide a workbench product that lets you string web services together. And one of the many web services offered was an EncryptionService that can decrypt a password protected PDF, and then another service that can get an XML representation of the data in the PDF.
So I simply called those two services, and done.

How to Download Documents from a a Sharepoint Document Library using Workflow Foundation?

I have some Test, Security, Project Management and some other word documents in TFS2010 source control under Documents folder. Does anybody know how to access them in order to download and copy to a local path?
Those files are not physically under $/... folder, though they have a Sharepoint web server path like: "http://myServer/sites/MyProyect/Test/Tests_P13_F00120.doc". I have tried to use DownloadFiles activity without success due to it needs a path which starts with $/. Any suggestion please?
DownloadFiles is not an activity you can make use of, it's meant to deal with files residing in Source control.
Instead, you need to establish a connection to the Sharepoint Copy service of your TFS, which resides at http://<Site>/_vti_bin/Copy.asmx. We did this by adding a Service Reference in our build solution.
We then implemented a build activity that does basically the opposite of what you are after: during TFS build it uploads documents into Sharepoint.
The instantiation looks like this:
BasicHttpBinding binding = new BasicHttpBinding();
binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None;
binding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;
EndpointAddress endpointAddress = new EndpointAddress("http://<Site>/_vti_bin/Copy.asmx");
CopySoapClient copyService = new CopySoapClient(binding,endpointAddress);
This copy service exposes a GetItem method, this is the one you should probably be invoking.
I 'm not aware if this GetItem is capable of supporting a http://myServer/sites/MyProject/Test/*.doc kind of thing

Resources