I am working with Dropbox and Microsoft word. I am able to download file from Dropbox and stored in local storage (in Document directory). Now i want to edit word document. I have tried couple of way but its not working for me.
Downloaded in local storage and open with Microsoft word using UIDocumentInteractionController but its opens read only copy and save in Microsoft word app:
let file = URL(fileURLWithPath: dirPath).appendingPathComponent("/\(filename)")
// Do whatever you want with the document
self.docController = UIDocumentInteractionController(url: file)
self.docController.delegate = self
self.docController.presentOpenInMenu(from: self.view.frame, in: self.view, animated: true)
Download in local storage and open with Microsoft word using the URL schemes for Microsoft word app but its fails with error Can't open file :
let url : NSString = "ms-word:ofe|u|\(directoryContents[0])|z|yes|a|App" as NSString
let urlStr : NSString = url.addingPercentEscapes(using: String.Encoding.utf8.rawValue)! as NSString
let searchURL : NSURL = NSURL(string: urlStr as String)!
UIApplication.shared.openURL(searchURL as URL)
Directly download file (Using Dropbox share link) in word app using the URL schemes for Microsoft word app but its fails with error Can't open file :
let url : NSString = "ms-word:ofv|u|https://www.dropbox.com/s/xxxxxx/new.docx?dl=0|p|xxxxxx|z|yes|a|App" as NSString
let urlStr : NSString = url.addingPercentEscapes(using: String.Encoding.utf8.rawValue)! as NSString
let searchURL : NSURL = NSURL(string: urlStr as String)!
UIApplication.shared.openURL(searchURL as URL)
I know this is because of iOS Sandboxing. It is not allowed to share data across the app. I don't want to use Dropbox app to edit the file and update it?
Is there any way to download word file from Dropbox and edit in-app or using Microsoft word app?


