Create a Ms Word template based on another template using c# -
i tried create word template based on exist template, have tried .docx using bookmarks , work have no idea how can change extension .docx .dotx
here code i've tried
object outputf = document.fullname.replace(".docx", ".dotx"); object fileformat = word.wdsaveformat.wdformattemplate; document.saveas(ref outputf, ref fileformat, 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);
but not result in .dotx word can work with. ideas?
the way turn word document (docx) template (dotx) use saveas command, specifying not file name parameter file type. takes enum, show in comment.
the trick enum must fit file extension. believe wdformattemplate old .dot file format. enum wdformatxmltemplate. (i'd you, msdn isn't letting me log in language reference...)
note: it's important describe how "doesn't work". example, error messages.
Comments
Post a Comment