Discussion Locked
Here... Where the tech hits my brain....
0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
blog root
After Hours
by mkyes
It's been a while since I wrote code.. it this challenge takes me to places I havent seen as of yet. it take me officially into VS 2005 and takes deeply back to Office 2003 to get some fields out and put them in a database. the code for this given all the Sp's etc I've put on is not too bad but here is a swag that shows you how to open a word document from .NET:
///<summary> /// Loads the Document specified by the documentName parameter ///</summary> ///<param name="documentName"></param> publicvoid OpenWordDocuments(string documentName){
object fileName = documentName; object isVisible = true; object missing = System.Reflection.Missing.Value; object readOnly = true; object confirmConversions = false; object addToRecentFiles = false; object revert = false; object wdOpenFormatAuto = Microsoft.Office.Interop.Word.WdOpenFormat.wdOpenFormatAuto;wordApp.Visible =
true; try{
Microsoft.Office.Interop.Word.
Document aDoc = wordApp.Documents.Open(ref fileName, ref confirmConversions, ref readOnly, ref addToRecentFiles, ref missing, ref missing, ref revert, ref missing, ref missing, ref wdOpenFormatAuto, ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing);}
catch (System.Exception e){
Console.Out.WriteLine("E:="+e);}
}
This discussion is closed to new replies.
Sort by Trending