/// <summary> /// Opens and returns the Word's document object for the given file. /// </summary> /// <param name="path">Full path to file.</param> /// <param name="bReadOnly">True for readonly, False for full access.</param> /// <returns>Word's Document object if success, null otherwise</returns> private object openDocument(string path, bool bReadOnly) { if (isAvailable && wordDocuments != null && wordDocuments != null) { if (path.Length > 255) // 255 for Word! { path = Path.GetShort83Path(path); } return(wordDocuments.GetType().InvokeMember("Open", BindingFlags.InvokeMethod, null, wordDocuments, new object[3] { path, MISSING_VALUE, bReadOnly })); } return(null); }
/// <summary> /// Opens and returns the Word's document object for the given file. /// </summary> /// <param name="path">Full path to file.</param> /// <param name="readOnly">True for readonly, False for full access.</param> /// <returns>Word's Document object if success, null otherwise</returns> private object OpenDocument(string path, bool readOnly) { if (isAvailable && wordDocuments != null && wordDocuments != null) { if (path.Length > 255) // 255 for Word! { path = Path.GetShort83Path(path); } bool addToRecentFiles = false; return(wordDocuments.GetType().InvokeMember("Open", BindingFlags.InvokeMethod, null, wordDocuments, new object[4] { path, MISSING_VALUE, readOnly, addToRecentFiles })); } return(null); }