Hello Welcome to Microsoft Q&A,
In UWP, how can I open a word document in a splitview content?
For your scenario , we suggest you use the Open XML SDK to achieve it, before using it, you need to install the DocumentFormat.OpenXml nuget package. Then using WordprocessingDocument.Open(Stream stream, bool isEditable) method to create a instance of WordprocessingDocument. If you want to display it in the splitview content, we suggest load Body's InnerText and display it with TextBlock.
Code below
private async void Button_Click(object sender, RoutedEventArgs e)
{
StorageFolder folder = KnownFolders.PicturesLibrary;
StorageFile sampleFile = await folder.GetFileAsync("hello.docx");
Stream randomAccessStream = await sampleFile.OpenStreamForWriteAsync();
var text = OpenextToWordDocument(randomAccessStream);
}
public static string OpenextToWordDocument(Stream stream)
{
var text = string.Empty;
// Open a WordprocessingDocument for editing using the stream.
WordprocessingDocument wordprocessingDocument = WordprocessingDocument.Open(stream, false);
// Assign a reference to the existing document body.
Body body = wordprocessingDocument.MainDocumentPart.Document.Body;
// Add new text.
text = body.InnerText;
wordprocessingDocument.Close();
return text;
}