how to launch a new word docment/excel/power point

2019-04-08 14:56发布

问题:

How can I launch a new Word/Excel/PowerPoint document within a Windows Phone 8 app?

Here's what I've tried, which doesn't seem to work:

await Launcher.LaunchUriAsync(new Uri("ms-word:"));

or

await Launcher.LaunchUriAsync(new Uri("ms-excel:"));

Can anyone see what I'm doing wrong?

回答1:

For WP8 this may help you.

StorageFile pdfFile = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync("demo.xls");
 // Launch the file.
  Windows.System.Launcher.LaunchFileAsync(pdfFile);