locked
Metro App: Create word document from metro app RRS feed

  • Question

  • Dear All,

    Please help me to save the content to the word document from my metro app.

    Regard's

    Gopalakrishna M

    Wednesday, September 4, 2013 8:41 AM

Answers

  • Hi, Gopikris

    As far as I know, the Office word namespace cannot be used in Windows Store App. Syncfusion sells some controls for windows 8 the control kit includes DocIO which allows you to read and write word files.

    You can refer to this link below:

    http://www.syncfusion.com/products/winrt/controls

    Best Wishes!


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    • Edited by Anne Jing Thursday, September 5, 2013 9:36 AM from
    • Marked as answer by Anne Jing Wednesday, September 11, 2013 7:50 AM
    Thursday, September 5, 2013 9:35 AM

All replies

  • You can save RichEditBox content as RTF file.

    XAML

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <StackPanel Margin="200">
            <RichEditBox x:Name="REB" Height="300" Width="400" />
            <Button Content="Save as RTF" Click="btnSaveAsRtf_Click"  HorizontalAlignment="Center" Margin="0,20,0,0"/>
        </StackPanel>
    </Grid>
    

    C#

    private async void btnSaveAsRtf_Click(object sender, RoutedEventArgs e)
    {
        var RtfFile = await ApplicationData.Current.TemporaryFolder.CreateFileAsync("RtfFile.rtf", CreationCollisionOption.GenerateUniqueName);
        using (var stream = await RtfFile.OpenAsync(FileAccessMode.ReadWrite))
        {
            REB.Document.SaveToStream(TextGetOptions.FormatRtf, stream);
        }
    }
    

    Wednesday, September 4, 2013 10:01 AM
  • Hi, Gopikris

    As far as I know, the Office word namespace cannot be used in Windows Store App. Syncfusion sells some controls for windows 8 the control kit includes DocIO which allows you to read and write word files.

    You can refer to this link below:

    http://www.syncfusion.com/products/winrt/controls

    Best Wishes!


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    • Edited by Anne Jing Thursday, September 5, 2013 9:36 AM from
    • Marked as answer by Anne Jing Wednesday, September 11, 2013 7:50 AM
    Thursday, September 5, 2013 9:35 AM