Need to create a link to open Powerpoint app in Desktop mode from Power VIrtual Agent (Teams) - chatbot

We have built a chatbot, which when engaged by user on one topic, opens a macro enabled powerpoint file from sharepoint.
we need the powerpoint file to be opened in dekstop mode, so as the macro file to be working, via power virtual agent in teams
Attempted two ways to make it work, which failed:
Tried to create the link from internet explorer which gets us the 'Save as' dialog box each time when we try to open it
Added 'ms-powerpoint:ofe|u|https://' before the link which gets translated to 'ms-powerpoint:ofe%7Cu%7Chttps://xxxx' which takes us to power virtual agent website.
Any guidance will be really helpful to us which enables us to open the file in desktop mode via chatbot.

Related

Can I upload a file to onedrive via Windows 10 command line?

I need to upload a file to OneDrive, via the command line. This will be done through a batch file which is distributed to end users.
From searching on Stack Overflow, I find questions like this one which say that you need to register an app and create an app password, using Azure. I don't have the necessary permissions to do this in the organization where I work, nor can I do anything that requires an admin account. So I can't any install software - I have to use what comes with Windows 10. I can't use VBA either as that's blocked.
I've managed to download files from OneDrive without anything like that, using the process described here:
Open the URL in either of the browser.
Open Developer options using Ctrl+Shift+I.
Go to Network tab.
Now click on download. Saving file isn’t required. We only need the network activity while browser requests the file from the server.
A new entry will appear which would look like “download.aspx?…”.
Right click on that and Copy → Copy as cURL.
Paste the copied content directly in the terminal and append ‘--output file.extension’ to save the content in file.extension since
terminal isn’t capable of showing binary data.
Example:
curl https://xyz.sharepoint.com/personal/someting/_layouts/15/download.aspx?UniqueId=cefb6082%2D696e%2D4f23%2D8c7a%2
…. some long text ….
cCtHR3NuTy82bWFtN1JBRXNlV2ZmekZOdWp3cFRsNTdJdjE2c2syZmxQamhGWnMwdkFBeXZlNWx2UkxDTkJic2hycGNGazVSTnJGUnY1Y1d0WjF5SDJMWHBqTjRmcUNUUWJxVnZYb1JjRG1WbEtjK0VIVWx2clBDQWNyZldid1R3PT08L1NQPg==;
cucg=1’ --compressed --output file.extension
I tried to do something similar after clicking 'upload' on the browser, but didn't find anything useful when trying to filter the requests.
I found these two questions but there is no keyboard shortcut to upload, AFAICT. Also the end user will be uploading a file to a folder I've shared with them from my OneDrive. Opening Chrome or Edge as a minimised window is fine, but I can't just shove a window in their face which automatically clicks on things - they won't like that.
It's just occurred to me that I might be able to use an office application to Save As the file to the necessary onedrive folder, where the keyboard shortcuts are pretty stable, but have no idea how to achieve that via the command line.
The best and more secure way to accomplish this goal I think is going to be with the Rest API for OneDrive.
(Small Files <4MB)
https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_put_content?view=odsp-graph-online
(Large files)
https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_createuploadsession?view=odsp-graph-online
You still need a Azure AD App Registration (which your admin should be able to configure for you), to provide API access to services in Azure. Coding with the API is going to be far easier and less complicated, not to mention more versatile.

VS Live Share and Live Server

We are using VS Live Share inside Visual Studio Code and the person who joined cannot open a shared HTML file with the Live Server extension. It says: Cannot GET .../index.html. Does Live Server only work with "local files"? There is also no option to open the shared HTML file in the file system and to open it that way. Help would be nice as quick as possible.
1-press the live share extension icon in the sidebar.
2-inside session details hover over shared servers sub-category.
3-an electrical plug with a green plus sign will show, press on it and an input field will pop up.
4-inside the input field write your localhost port like this e.g: localhost:5500 and press enter.
you can find the number of your port from the bottom right of vs code if you have a live server running. it will look like this: Port:5500.
once you do this a notification will automatically show in your partner's vs code to open the shared live server.

Opening OneDrive file in desktop Word

I'm trying to open a file for edit from Office365's OneDrive in desktop version of Word(I'm logged in with my Office 365 account) using ms-word protocol and I have noticed that there are several possibilities:
Sometimes file opens in edit mode, I can edit file and by pressing Ctrl + S save it directly to OneDrive without being prompted for any additional actions.
Sometimes file opens in Read Only mode, I can switch to Editor mode, but then when I try to save file I'm prompted to specify save location(default location is my OneDrive directory with this file).
Sometimes Word asks me to login to my Office365 account(even though I'm logged in with this account in Word), then opens file in Read Only mode and after it looks like 2nd case.
I would like to open it as described in 1st case so user doesn't have to make any additional actions.
My current scenario is:
User calls an API to create file.
API creates file in user's OneDrive using Microsoft Graph.
API returns direct URL to file and I open this file in Word using ms-word protocol.
By direct URL to file I mean: https://domain-my.sharepoint.com/personal/account/Documents/Apps/Microsoft Graph/appname/directoryname/filename.docx
URL to open file looks like:
ms-word:ofe|u|<file path specified above>
And as I described at the beginning there are 3 cases how file is opened and it looks randomly for me.
I have also noticed that when I open my file in Word Online(using web url to file) and then I press Edit in Word it uses exactly the same file URL I have created and returned to user but from here the file always open with 1st scenario.
Do you have any ideas why this behaves differently when I manually open file using ms-word protocol compared to Word Online using ms-word protocol with exactly the same url?
I would like to always open file from user's OneDrive in desktop Word in scenario when user doesn't have to make any additional steps to edit and save file back to OneDrive.
(I don't have reputation so I can't comment. I will try again with a partial answer.)
There is always a chance that the credentials will have to be refreshed, so there is no way to completely prevent Office apps from prompting for credentials but it should be relatively uncommon.
As to the issue of opening in edit mode vs protected mode: There are a variety of reasons why some files will open into protected view: https://support.office.com/en-us/article/What-is-Protected-View-d6f09ac7-e6b9-4495-8e43-2bbcdbcb6653
If you have a file that seemingly opens in edit mode vs some version of readonly or protected view, please use answers.microsoft.com where the conversation doesn't have to fit into the stackoverflow model.
when I open my file in Word Online(using web url to file) and then I press Edit in Word it uses exactly the same file URL
You suggest that the URLs are identical, but my first thought was that the difference may have been that the Word Online link uses the driveItem's webDavUrl property rather than baseItem's webUrl
https://learn.microsoft.com/en-us/onedrive/developer/rest-api/resources/driveitem#json-representation

Openoffice Writer macro that uploads current file to a web service on save

I want to know if this is doable and get some hints about how to achieve this.
I guess at least it would need a confirmation dialog to run the (possibly evil) macro.
I want to produce an OpenOffice document that will upload itself on save to a hardcoded URL.
Is it possible?
What are the rough steps to achieve this?
My guess is:
bind a macro to the save event
have that macro get the current file binary data
have it post this data to a URL
but before researching about how to do this I need to know if this can be done in the first place.
I don't believe you need a macro to do this, instead depending on your OS you can map a FTP or other type of protocol remotely.
For example in windows you can "Map" a FTP as a drive and this would do exactly the same thing as your describing, you open the file from the FTP and upon saving it will then be written to the remote server. FTP is just an example here, there are other platforms you can use.
If you are at all interested in this method then following the instructions below, otherwise disregard.
Mapping a Network Drive in Windows Vista and 7.
Click on Windows start orb and then click on "computer".
Click on map a network drive.
Map a network drive will then open a new dialog box where you can click "connect to a website"
Simply follow that easy to use wizard and click add a new network location (Choose a custom network location)
Type in your FTP address, including username and password.
Finally name your network location to whatever you want.
Just a suggestion, I really don't think you need any macro unless you plan on distributing these files to other people then yes, but they would need to install that macro/plugin on their open office since there is no way to encode the document itself with such features as far as I know.

Office integration (Word) - intercepting save

I am planning to implement a small in-house document management system. It must have a web GUI for managing a remote folder structure stored in a database. In these folders are word documents stored (physically as blob in a database). Whenever a user clicks on a document link, a word binary is downloaded via browser and (hopefully) opened in Word on the user's PC.
This is the easy part ;)
Now the user hits "Save" or Ctrl-S. I want to have a functionality programmed inside Word that calls a custom function (maybe in a .NET DLL) that uploads the saved file back to the server (HTTP). The hard part seems to me:
How to intercept the Save process to call the extension functionality
How to deploy this to multiple users
Mike's link to the question I answered should do it for intercepting the file save. The specific button idMso for File->Save is "FileSave"
To deploy it to several users machine you can either
Create a setup project that will create an msi that you can run on all the users machines
if it's an intranet scenario, you can keep the assemblies on a network location and just add the neceassary registry settings to all the users machines. This article should describe the settings that you need to include. You would just need to change the path setting to point to the network location.
AFAIK, this is what Alfresco is doing with its Microsoft Office Add-ins (never tested myself though). As Alfresco is open-source, it must be possible to look at what they are doing. Or just ask your questions on Alfresco's forums.
You can try to override "save" from the ribbon or build your own ribbon tab with the behavior you want. It may be trickier overriding "Ctrl-S".
Overriding the ribbon: StackOverflow Question
Video on altering a standard ribbon button: Office Developer Center