Search code examples
c#windows-phone-8isolatedstorageisolatedstoragefile

Open file from isolatedstorage in default app (Windows Phone 8)


I have a question about opening a file stored in IsolatedStorage in my Windows Phone 8 C# app (in my case a file.txt file) and opening it up in Office suite integrated in WP 8.

I have come up with this:

 Windows.System.Launcher.LaunchUriAsync(new System.Uri("ms-word:" + (new Uri("file.txt", UriKind.Relative))));

It opens up Office Word with no problem, but it hangs at the "file does not exists" message and quits.. Any advice ? Thanks :)


Solution

  • Your Uri is wrong. It should be new Uri("ms-word:isostore:file.txt", UriKind.Absolute); But still, the file can't be opened. Don't know why.

    enter image description here

    EDIT: This is not possible. You can only open office email attachments or office documents from OneDrive.

    http://answers.microsoft.com/en-us/winphone/forum/wp8-wppersonal/open-word-and-excel-files-from-sd-card/23218c41-b72b-49df-9529-5e85a1912bc5