1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
string cvcommercial = ConfigurationManager.AppSettings["CV"];
string save2 = ConfigurationManager.AppSettings["save2"];
Object oTemplatePath = cvcommercial;
doc = oWordDoc.Documents.Open(ref oTemplatePath, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
Object bookmark = "Nom";
Microsoft.Office.Interop.Word.Range bookmarkRange = doc.Bookmarks.get_Item(ref bookmark).Range;
bookmarkRange.Text = Nom;
Object oSaveAsFile = (Object)save2;
doc.SaveAs(ref oSaveAsFile, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing);
doc.Close(ref oMissing, ref oMissing, ref oMissing);
oWordDoc.Quit(ref oFalse, ref oMissing, ref oMissing);
Page.RegisterStartupScript("openwin", "<script>window.open('" + save2 + "');</script>"); |
Partager