Answered by:
Open Office for Android apps in edit mode from another app

Question
-
Hi.
I'm trying to edit a file from my app in Microsoft Word for Android. I've implemented my own DocumentsProvider and I'm able to open Word, browser to my provider and edit my files.
However, if I want to open a file from my app, it always opens as read only.
This is my code
Uri wordUrl = Uri.parse(
"content://my.documents.provider.authorities/document/my-file-id"
);
Intent wordIntent = new Intent(Intent.ACTION_VIEW);
wordIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
wordIntent.setPackage("com.microsoft.office.word");
wordIntent.setData(wordUrl);
startActivity(wordIntent);Please note that I also tried to modify the first line to
Uri wordUrl = Uri.parse(
"msword:ofe|u|content://my.documents.provider.authorities/document/my-file-id"
);as described in https://msdn.microsoft.com/en-us/library/office/mt238280.aspx, but in this case, the file doesn't open at all (getting an error message in Word).
Any ideas?
Thanks!
- Moved by Mattew Wu Friday, April 6, 2018 9:55 AM not dev center issue
Wednesday, April 4, 2018 4:03 PM
Answers
-
Hello,
you should ask here: https://answers.microsoft.com/
or here: https://social.technet.microsoft.com/Forums/office/en-US/home?category=officeitpro
- Proposed as answer by Richard MuellerMVP Friday, April 6, 2018 1:22 PM
- Marked as answer by Dave PatrickMVP Thursday, April 12, 2018 3:58 AM
Friday, April 6, 2018 10:04 AM -
I would ask here:
https://answers.microsoft.com/en-us/msoffice/forum/msoffice_word
Richard Mueller - MVP Enterprise Mobility (Identity and Access)
- Proposed as answer by Richard MuellerMVP Friday, April 6, 2018 1:22 PM
- Marked as answer by Dave PatrickMVP Thursday, April 12, 2018 3:58 AM
Friday, April 6, 2018 1:22 PM
All replies
-
Hi Zvis,
Since your question is not within the scope of Dev Center App forum, I will move your thread so that it might will appear under proper category.
Thanks for your understanding.
Best regards,
Mattew Wu
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.Friday, April 6, 2018 9:54 AM -
Hello,
you should ask here: https://answers.microsoft.com/
or here: https://social.technet.microsoft.com/Forums/office/en-US/home?category=officeitpro
- Proposed as answer by Richard MuellerMVP Friday, April 6, 2018 1:22 PM
- Marked as answer by Dave PatrickMVP Thursday, April 12, 2018 3:58 AM
Friday, April 6, 2018 10:04 AM -
I would ask here:
https://answers.microsoft.com/en-us/msoffice/forum/msoffice_word
Richard Mueller - MVP Enterprise Mobility (Identity and Access)
- Proposed as answer by Richard MuellerMVP Friday, April 6, 2018 1:22 PM
- Marked as answer by Dave PatrickMVP Thursday, April 12, 2018 3:58 AM
Friday, April 6, 2018 1:22 PM