I have a scenario where the user's open PowerPoint presentation needs to be modified by a custom solution. I'm looking at using a PowerPoint web add-in in conjunction with the Graph API's support for OneDrive/SharePoint files.
However, PowerPoint has nothing specifically available in the JavaScript for Office API yet for replacing the contents of the actively edited presentation. As a proof of concept, I've tried using Graph to overwrite a specific PowerPoint file in OneDrive using the upload command, but it throws an error because the file is open in PowerPoint for Windows:
Status Code: 423 Microsoft.Graph.ServiceException: Code: resourceLocked
Message: The resource you are attempting to access is locked
Inner error: AdditionalData:
date: 2020-10-05T21:06:53
request-id: 5e3c2604-382d-4139-a433-8b95ef4f619e
client-request-id: 5e3c2604-382d-4139-a433-8b95ef4f619e
ClientRequestId: 5e3c2604-382d-4139-a433-8b95ef4f619e
I note that if I open that same file in PowerPoint Online, the sharing icon indicator triggers and I'm able to make changes in either editor that are nearly immediately updated in the other editor. So a protocol exists for making live changes. I'm guessing this is through WOPI??. Is there another Graph method available I can use that can support this scenario? Or do I have to build a full WOPI client and/or server solution to do this (which looks insane, if it's possible)?
Related
For my project need, I need to convert MS format documents in to pdf. I started exploring microsoft graph API. For easiness I started with graph explorer(using my corporate and personal login) on https://developer.microsoft.com/en-us/graph/graph-explorer.
I have added sample document in drive and using https://graph.microsoft.com/v1.0/me/drive/root/children, I got itemId of my file.
Now, I am trying to convert it into pdf using https://graph.microsoft.com/v1.0/me/drive/items/{itemId}/content?format=pdf. But I am always getting response as Failure - Status Code 0
Anyone has an idea how to fix this issue?
Here is an attached screen shot of microsoft graph explorer
Note: I found similar problem here but it is not solved
According to your description, I assume you want to convert .docx file to pdf using Microsoft graph API.
Based on my test, we can use https://graph.microsoft.com/v1.0/me/drive/items/{itemId}/content?format=pdf.
It will return a failure response when run it in graph explore. However, when we use the develop control panel, we can get this request and response.
Location properties are in the response headers. It is the address of the converted file.
We can use this URI to review or download the document that converted.
The request URL:
https://graph.microsoft.com/v1.0/me/drive/items/{itemId}/content?format=pdf
The response may like this:
I'm building an application in ColdFusion that lets the user choose a group of photos and will let them be printed automatically, however, I need to print the file and not the webpage holding the images. Is this possible with CFFILE? If not what is the best way to do this?
Dan's suggestion of an Active-X control (even if it's possible) will only work for MSIE 11 and earlier. Active-X will not work for MS Edge or any non-MS browser. It's not a global, future-proof solution.
The best solution will be to convert the images to a multi-page PDF file as TRose suggests. You will then present the file to the user to download or view in the browser. The user will have to manually print the PDF file.
Here's why: ColdFusion is a server-side applicaiton server. It crafts content that is viewable via a web browser. For security reasons, web browsers cannot automatically aceess a user's local computer(1) and therefore cannot connect to any printer connected to that computer.
(1) This is also why we can't upload files without user interaction.
I'm building a Reporting web application right now with MVC3 and I've come up to a couple problems.
My goal is to have it able to generate and view Crystal Reports, SSRS reports, and Excel documents.
Right now I'm working on the Excel segment and I'm running into more trouble than I thought I would. First off, when I link directly to the file, it either opens inside the browser or it downloads it from the server and if the user makes changes it doesn't actually save it to the true file on the server.
I've tried both linking to the file directly using Razor and a ViewModel with the path to the document as well as directing it to an action that returned a File.
I've also tried linking it to a shortcut to the actual file thinking that if I could open the shortcut it would open the file the way I wanted it to and unfortunately it didn't really open at all.
The users already have access to the files on the server through a network drive, so as of right now they can go into the server, open the excel document, edit and save it no problem. I want to duplicate this effect through a link. The program already has a file browser built, so I can browse between the files and make links to the reports.
Thanks in advance!
Since they are apparently on a network drive, you can just link to the files directly, relative to the user?
For example: a link to file://///SERVERNAME/folder/
I tested it between two computers on the network, and that seems to work. However, you still get a popup asking that you want to do with the file, open or save. (both in firefox and IE)
Note: Yes, that many slashes seem necessary, lol
I am working on an internal application. We have a website that displays all our SSRS reports for a group of work. I have been asked to see if I can link all the files (pdf, word, excel) for the group of work. These files are stored on a file server that users viewing the reports have access to. Each group has its own group of reports and shared files.
Is it possible to open the files (without downloading them) from a webpage? Meaning that they file is opened from the file server? I don't want people to download a copy of the file.
I am pretty sure this can work with IE because sharepoint does it. However, other browsers may have an issue.
EDIT: What I would like is to have a web page with links to the files. When they click on a link (say for a word doc), word will open the file that resides on the file server. Without out a local copy downloaded from the network share.
EDIT2: Please note, I know what I am asking is probably not possible in all browsers. I am more or less just making sure. It seems possible in IE using activeX, but out side of that browsers do a good job at keeping processes inside a sandbox.
3 options. Remember this is for an internal website.
link to the share using file://. This will have the side affect of downloading the file to be viewed. As long as user clicks open every time it should not be a big deal.
Use JavaScript and activeX to open word (excel, reader, ect) passing in the file path as a command line arguments. This works only in IE and in win7 (probably vista) user will get a pop up asking if it is ok for the activeX control to run.
Create a new protocol. openfile://. This would be set up to run an application that is installed on the client machine which would open the file. Since it is internal, the application could be installed on the machines without issues. This also requires a registry change.
I haven't picked one as this change is still being looked into but i figure I would update this in case someone runs into something similar.
I am developing a Delphi documents management application, so somehow I am giving the user some functionality similar to windows explorer.
I would like to know if there is a way to get the preview used by windows explorer. For example windows explorer creates a small thumbnail for a pdf document for example, and displays it when the user chooses to view "big icons". Is there a way to retrieve that preview?
MyTImage := GiveMePreviewForFile('C:\Test\File.pdf');
#user193655, using the IExtractImage interface is the way to go, this interface exposes methods that request a thumbnail image from a Shell folder
you can find a very complete sample in this site and the source code is here.
check this image
Take a look at the docs for IExtractImage. Basically you use IShellFolder with IExtractImage to get the picture you are looking for.