private void button1_Click(object sender, RoutedEventArgs e) { // Create OpenFileDialog Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); dlg.DefaultExt = ".doc"; dlg.Filter = "Word documents|*.doc;*.docx"; Nullable<bool> result = dlg.ShowDialog(); if (result == true) { // Open document string filename = dlg.FileName; FileNameTextBox.Text = filename; var document = DocX.Load(filename); string contents = document.Text; } }
FlowDocument
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)