0

I have this code for launching a file on Windows phone 8:

string ppFile = @"Assets\Documents\test.txt";
var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(ppFile);
var success = await Windows.System.Launcher.LaunchFileAsync(file);

When I have a *.txt file windows phone 8 is launching it. But I want to launch a "example.pptx" file, the code doesn't work. Are there perhaps permission problems with the PowerPoint file?

1 Answers1

0

The code you specified is correct for launching any file, either txt or pptx. Both cases should work just fine.

Could you please verify in the solution explorer that the Build Action for the pptx file is set to "Content"? When adding a txt file it defaults to Content, however for pptx is defaults to None. Adjusting it to Content will probably solve your issue.

Tom Verhoeff
  • 1,270
  • 6
  • 12
  • Yes, you are right! The Problem is solved after changing the build action (in Property Explorer) from "NONE" to "CONTENT". It was very helpful. – SirIsaac Aug 09 '13 at 11:48