Last active
December 20, 2015 22:29
-
-
Save felixlindemann/6205396 to your computer and use it in GitHub Desktop.
c# vsto savefileas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Save() | |
{ | |
Saving = true; | |
try | |
{ | |
writeProperties(); | |
Document doc = getDoc(); | |
FileInfo f = new FileInfo(doc.FullName); | |
String strFileName = String.Format(@"{0}\{1} - v.{2}.{3}.{4}.docx", f.Directory.FullName, DocTitle, Revision, Version, Build); | |
object missing = System.Reflection.Missing.Value; | |
object fileName = strFileName; | |
object format = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatDocumentDefault; | |
doc.SaveAs(ref fileName, ref format, ref missing, ref missing, | |
ref missing, ref missing, ref missing, ref missing, | |
ref missing, ref missing, ref missing, ref missing, | |
ref missing, ref missing, ref missing, ref missing); | |
} | |
catch (Exception ex) | |
{ | |
MessageBox.Show(ex.ToString()); | |
throw; | |
} | |
Saving = false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment