Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8844061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:23:32+00:00 2026-06-14T11:23:32+00:00

I’m simply trying to attach a file named Document.pdf in the DocumentsLibrary to an

  • 0

I’m simply trying to attach a file named Document.pdf in the DocumentsLibrary to an email using the Share Charm. My code below works perfectly on the Local Machine:

    private async void OnDataRequestedFiles(DataTransferManager sender, DataRequestedEventArgs e)
    {
        List<IStorageItem> shares = new List<IStorageItem>();
        StorageFile filetoShare = await Windows.Storage.KnownFolders.DocumentsLibrary.GetFileAsync("Document.pdf");

        if (filetoShare != null)
        {
            shares.Add(filetoShare);
            filetoShare = null;
        }

        if (shares != null)
        {
            DataPackage requestData = e.Request.Data;
            requestData.Properties.Title = "Title";
            requestData.Properties.Description = "Description"; // The description is optional.
            requestData.SetStorageItems(shares);
            shares = null;

        }
        else
        {
            e.Request.FailWithDisplayText("File not Found.");
        }
    }

But when I run the exact same code on a Windows Surface Tablet, I get the dreaded “There’s nothing to share right now.” on the right in the Charms flyout area.

Here’s a little more background to help:

  • I’m not looking to use a File Picker…I know the exact file I’m looking for
  • I’ve enabled the Documents Library Capability in the manifest
  • I’ve added a File Type Association for pdf in the manifest
  • and yes, the file does exist and is in the Documents Library
  • an email account is properly setup in the Mail App on the surface
  • I can successfully send text emails from the Tablet…just not emails with attachments

Like I said, this works on my Win 8 Development Machine as expected…just not on the Surface. I’m wondering if the Surface has different file or folder permissions?

Thanks for the help…this is driving me CRAZY

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T11:23:33+00:00Added an answer on June 14, 2026 at 11:23 am

    I finally figured it out – the problem was that my Event Handler was async (so that I could use await to set the StorageFile variable).

    I solved it by setting the StorageFile variable earlier in my code so that it was already available when the Event Handler was called.

    I still have no idea why it worked on my development machine, but no on the WinRT surface…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to render a haml file in a javascript response like so:
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.