Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object filePath;
- Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
- dlg.Filter = "Word 2007 file|*.docx |Word 2003 doc|*.doc";
- Nullable<bool> result = dlg.ShowDialog();
- filePath = dlg.FileName;
- object typeMissing = Type.Missing;
- Documents documents = application.Documents;
- _Document document = documents.Open(ref filePath, ref typeMissing, ref typeMissing, ref typeMissing, ref typeMissing, ref typeMissing, ref typeMissing, ref typeMissing, ref typeMissing, ref typeMissing, ref typeMissing, ref typeMissing, ref typeMissing, ref typeMissing, ref typeMissing, ref typeMissing);
- //Read the table
- Range range = document.Tables[1].ConvertToText();
- object[,] dataArray = (object[,])range.get_Value(Microsoft.Office.Interop.Excel.XlRangeValueDataType.xlRangeValueDefault);
Add Comment
Please, Sign In to add comment