General discussion

  • Creator
    Topic
  • #2257776

    Here… Where the tech hits my brain….

    Locked

    by mkyes ·

    blog root

All Comments

  • Author
    Replies
    • #3230263

      Challenge of the day

      by mkyes ·

      In reply to Here… Where the tech hits my brain….

      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);

      }

      }

Viewing 0 reply threads