Ejemplo n.º 1
0
 /// <summary>
 /// 另存新档
 /// </summary>
 /// <param name="filePath"></param>
 /// <param name="format"></param>
 public void SaveAs(string filePath, WordSaveFormat format = WordSaveFormat.docx)
 {
     try
     {
         if (_version > 12.0)
         {
             //"SaveAs2" only support office 2010 and above version
             _wordDoc.SaveAs2(filePath, format, _missing, _missing, _missing, _missing, _missing, _missing, _missing, _missing, _missing, _missing, _missing, _missing, _missing, _missing, _missing);
         }
         else
         {
             _wordDoc.SaveAs(filePath, format, _missing, _missing, _missing, _missing, _missing, _missing, _missing, _missing, _missing, _missing, _missing, _missing, _missing, _missing);
         }
     }
     catch (Exception ex)
     {
         ErrorParser(ex);
         return;
     }
 }
Ejemplo n.º 2
0
        public static void SaveAs(object WordObject, string FileName, WordSaveFormat WordFormat)
        {
            #region Params SaveAs
//			expresión.SaveAs(
//				FileName,
//				FileFormat,
//				LockComments,
//				Password,
//				AddToRecentFiles,
//				WritePassword,
//				ReadOnlyRecommended,
//				EmbedTrueTypeFonts,
//				SaveNativePictureFormat,
//				SaveFormsData,
//				SaveAsAOCELetter)
            #endregion

            object[] Parameters;
            Parameters    = InitializeParameters(11);
            Parameters[0] = FileName;
            Parameters[1] = WordFormat;

            WordObject.GetType().InvokeMember("SaveAs", BindingFlags.InvokeMethod, null, WordObject, Parameters);
        }
Ejemplo n.º 3
0
        public static void SaveAs(object WordObject, string FileName, WordSaveFormat WordFormat)
        {
            #region Params SaveAs
            //			expresión.SaveAs(
            //				FileName,
            //				FileFormat,
            //				LockComments,
            //				Password,
            //				AddToRecentFiles,
            //				WritePassword,
            //				ReadOnlyRecommended,
            //				EmbedTrueTypeFonts,
            //				SaveNativePictureFormat,
            //				SaveFormsData,
            //				SaveAsAOCELetter)
            #endregion

            object[] Parameters;
            Parameters = InitializeParameters(11);
            Parameters[0] = FileName;
            Parameters[1] = WordFormat;

            WordObject.GetType().InvokeMember("SaveAs",BindingFlags.InvokeMethod,null,WordObject,Parameters);
        }