How to create a hyperlink to a onedrive file or folder without sharing it with anyone - and then use it - onedrive

(Once the hyperlink is created I will use it in OneNote to link to a file on my own Onedrive, for only me to use !)
When I view a file in Word online the URL displayed is:
https://onedrive.live.com/view.aspx?cid=53B31F7A44698440&resid=53B31F7A44698440%2130033&app=Word
Say I want to insert a link to the file in a website or OneNote page, such that it has NOT been shared with anyone. ie Only I have permissions to view it like the file reference by the above link.
Can I simply use the above URL as a link?
I have used OneDrive sharing, but I think all the methods given result in the file being shared with other named people or publically. eg like this one:
http://1drv.ms/1zOli6p
...which when viewed in word online shows this URL:
https://onedrive.live.com/view.aspx?cid=53B31F7A44698440&resid=53B31F7A44698440%2130035&app=Word
I have been experimenting and using the URL seems to work. However, if the above does work, what I don't get is why OneNote does not allow a link to be created to a file stored on Ondrive. (On my PC it sonly seems to allow links to locally stored files).
I have used GoogleDrive which allows you to select a file and right click it to "receive a link" which you can use in the manner described above. This is a really useful feature.
Note that in a similar way, I would like to create a link that causes onedrive to open and display a chosen folder. This seems to work ok when I use a URL this one that only I have permissions to view:
https://onedrive.live.com/?cid=53B31F7A44698440&id=53B31F7A44698440%2130031
Any advise is really appreciated.
Harvey

The links you copy/paste from your browser's address bar should work just fine, as your experiments have confirmed. If you're not trying to share the content with other people, you don't need to go through the sharing flows. You can just use those URL's.
From within OneNote itself you can also get links to content by right-clicking on a page/section/notebook and clicking 'copy link to page,' 'copy link to section,' etc.

You can open folder in OneDrive online (via browser or right clicking on the folder in File Explorer then selecting "view online") and click "get link" at the top. Just cut and paste into OneNote. From there you can edit/rename the link as usual.
Oddly, OneNote has functionality to copy a FILE link using the Insert > Link, but you can't stop at the folder level.
Ideally, I'd like the above option as well as dragging a folder from OneDrive within Windows File Explorer and have it ask me if I want to copy the entire folder or create a link.

I use links in format
https://onedrive.live.com/edit.aspx?resid=fd5d9e0ac8248db7!3447 (example, not real link)
or
https://onedrive.live.com/?id=fd5d9e0ac8248db7!3447
where
fd5d9e0ac8248db7 - is your ID number, and
3447 - is ID number of element (folder, Word file, OneNote notebook, media etc.)
P.S. Link format for open .one files online and folders inside OneNote online:
https:/ /onenote.officeapps.live.com/o/onenoteframe.aspx?Fi=SDfd5d9e0ac8248db7!3447&H=emul&C=5_810_BN1-SKY-WAC-WSHI&ui=Ru-RU
(example, not real link)
where
https:/ /onenote.officeapps.live.com/o/onenoteframe.aspx?Fi=SD_____yourIDnumber___!___elementID____&H=emul&C=5_810_BN1-SKY-WAC-WSHI&ui=Ru-RU

OneDrive has a "Copy link" function in a few places that you would think does what it states. However, as soon as you select "Copy link", a share is created with the defaults of your OneDrive (which could be your organisation's). In my case, the default is share with editing permissions. This is probably the last thing you would expect when you are requesting to "Copy link". This is really quite dangerous, since the now shared link could be used by anybody if it subsequently forwarded to others.
Why would you want to copy a link? My use case is that I have a folder shared as read only with specific people. I want to give them a link to a sub-folder or file that they already have access to, but I do not want to create new permissions, that in my case give editing to anybody with the link!
It seems that the way to properly "copy a link" (literally) is as suggested ie copy the URL from the address bar.

Related

Excel on Mac. Cannot open IQY file in Data/Get External Data/Run Web Query

I am running Excel version 16.45 on Mac.
I have created a .iqy and saved it in the Queries directory alongside certain templates which were already there.
I go to Data/Get External Data/Run Web Queries. While the templates are accessible, my file is visible but greyed out (same thing happens if I save the file in a different directory).
Would anyone be able to help?
According to your information, I would like to confirm whether the issue occurs when you follow the steps as below:
1.Create a Word file, paste the web URL.
2.Save the Word as .iqy with .txt format.
3.Choose MS-DOS as coding.
4.Create an Excel file and click "Data >Get External Data >Run Web Query (Or Run Saved Query) " of the Bar
I was able to address the issue as follows.
When navigating to the relevant directory with Finder, the '.iqy' file appears to be appropriately named (as per Image 1).
In fact, if you reach the file in Terminal, the file is saved as '.iqy.txt'.
So all I had to do is rename the file, simply removing the '.txt' string at the end.
Screen you see when navigating in Finder

Simulate drag & drop file to website in VBA

I have an Access database that uses VBA code to generate a GPX map file. That works fine. I then want the contents of the GPX file to be displayed on a website, https://mapy.cz
The method that the site authors intend is for users to open the site, then manually drag and drop GPX files onto the site, at which point the contents are read in and displayed by the website. This also works fine.
What I want to do is NOT require my database user to open a browser, locate the file and drag it onto the browser by hand. I want my VBA code to not only create this GPX file, but also open the user's default browser, direct it to this mapping site (all this also works okay), but then SIMULATE or FORCE the drag and drop action FROM MY VBA CODE. That is the part that on which I'm floundering. I've looked up things like using VBA's IE.Document object, and it seems to me that it should be in there somewhere, but I can't find anything that makes sense to me.
I've done similar things in the past, with SendKeys to simulate the user typing, and AutoIT to code-control a running DOS application, including reading the programs responses from the DOS screen and forcing in commands, all from VBA. It seems to me that this should be possible, and not even all that uncommon a requirement, but I've not located anything helpful in all my searching, and I've done a lot. Maybe I'm simply phrasing my searches wrong, but at this point, I'm just flat stuck.

I want to copy the file in sandbox without NSOpenPanel

I want to copy some files to specified folder by NSOpemPanel.
The source file is reading from XML and show to list in NSTable.
I can copy file by copyItemAtPath.
But now my app will turn to sandbox, then I can’t copy the file by copyItemAtURL.
How do I copy the file in sandbox mode?
I was looked over a lot of post. And I think the Security-scoped Bookmark may be a solution for this.
But I can’t create "Security-scoped Bookmark" from XML inside the path (the path was convert to NSURL ready).
I was setting to sandbox.entitlements but it's not clear this problem.
Is there any way for this?
Develop in macOS10.12 and Xcode8.3.3
Thanks
How do I copy the file in sandbox mode?
It is unclear what your current code is doing, but the rules under the sandbox are simple: To read or write a file located outside of an application's own container (which is hidden away under the Library folder) your application must either:
Use NSOpenPanel to obtain a URL from the user for the file path; or
Use NSOpenPanel to obtain a URL from the user for one of the ancestor folders of the file.
The second option gives access to a whole folder, including any sub-folders; i.e. the whole file/folder subtree rooted in the folder.
As you want to copy "some files" it sounds like asking the user for permission for the folder is appropriate. You can customise the NSOpenPanel to be a "request permission" dialog. If you are requesting a specific folder you can also have the dialog open in it's containing folder and only have the specific folder enabled for selection by the user.
Once you have the URL for the folder from NSOpenPanel you can create a security scoped bookmark for it and save that in your app's preferences or other configuration file (stored within the app's container). Doing this enables your app to regain access to the folder on subsequent executions without asking the user again.
If after investigating this issue and writing some code you hit an issue ask a new question, showing your code, and explaining the problem. Someone will undoubtedly help you with the next step.
HTH

Select a file and get its path and filename

Using VS 2013 and vb.
I have a web page and on a button click i would like file explorer to open so the user can navigate to a folder location and highlight a file. The web application will then get the path and filename of the file. Just to be clear I dont want to open the file I just want the details.
I cant seem to find a way of doing this, can you help?
UPDATE
Apologies perhaps I havent explained my self very well.
This is so a user can reference a document saved on a file share with a particular audit (the web page is for recording audits). Therefore they will click a button and file explorer will open. They will navigate to a folder (will be different everytime) and select a file. File explorer will then close and the web application will know the path of the file and its name. I can then use this to create a link on the web page to that document.
For getting directory path use; System.IO.Path.GetDirectoryName(path)
For file name System.IO.Path.GetFileName(path) or System.IO.Path.GetFileNameWithoutExtension(path)
more info is available at http://www.dotnetperls.com/path
Use path.getFullPath() method to get the file path as a string.
If you want to get the file name only use path.getFileName() method.

How to find the "Saved Pictures" folder in OneDrive?

When you save a picture in Windows Phone (browse the web and save a picture from any website), it is automatically saved to a "Saved Pictures" folder (local) and uploaded to a "Saved Pictures" folder in OneDrive.
I'm trying to create an app which is able to save pictures to OneDrive, and I want to save to that folder.
Is there a way to find that folder?
I know some folders (Camera roll, documents, etc.) have friendly names (/me/skydrive/camera_rol, /me/skydrive/my_documents, etc.). Is there some name to this Saved Pictures? Or is it specific to Windows Phone (Windows Phone creates it).
Thanks in advance.
UPDATE: in case you are wondering, what I'm trying to do is to develop the Chrome extension I suggested in UserVoice.
Using the new Onedrive API, there is a way to get access to "special folders", and there is a undocumented folder named "savedPictures", but it doesn't work.
I raised an issue in their bugtracker and they told me would be fixed.
Once it gets fixed, the right way to access the Saved Pictures folder will be to
GET /drive/special/savedPictures
Unfortunately I don't believe the "Saved Pictures" folder is accessible via this mechanism, and on top of that here isn't an easy way to find it yourself since it can be moved and renamed by users.