Windows phone 8 如何在Windows phone 8或8.1上打开office文件(.doc、.ppt等)?
我的应用程序的本地存储存储了一些MS office文件,如何从我的应用程序打开并显示它们?希望代码类似于选择照片。 如果是,那么考虑下面的片段:Windows phone 8 如何在Windows phone 8或8.1上打开office文件(.doc、.ppt等)?,windows-phone-8,windows-phone-8.1,Windows Phone 8,Windows Phone 8.1,我的应用程序的本地存储存储了一些MS office文件,如何从我的应用程序打开并显示它们?希望代码类似于选择照片。 如果是,那么考虑下面的片段: FileOpenPicker openPicker = new FileOpenPicker(); openPicker.ViewMode = PickerViewMode.Thumbnail; openPicker.SuggestedStartLocation = PickerLocationId.Do
FileOpenPicker openPicker = new FileOpenPicker();
openPicker.ViewMode = PickerViewMode.Thumbnail;
openPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
openPicker.FileTypeFilter.Add(".doc");
openPicker.FileTypeFilter.Add(".docx");
// Launch file open picker and caller app is suspended and may be terminated if required
openPicker.PickSingleFileAndContinue();
如果你的应用程序刚下载了一个文件,它进入了存储文件夹,你可以使用Launcher类从手机上启动一个应用程序,它可以为你打开下载的文件 类StorageFolder将帮助您获取StorageFile。 考虑到您已经拥有StorageFile类型的对象,您可以使用以下行从手机自动启动合适的应用程序:
await Launcher.LaunchFileAsync(storageFile);
这将打开与文件类型关联的应用程序。
我希望我清楚地回答了你的问题,并且回答了正确的方向。
谢谢