c# - Unable to edit a word template 2007 using Microsoft.Office.Interop when running through ASP.NET -
i unable edit word template 2007 when trying run web application through iis using microsoft.office.interop.word .but in development environment running fine. below code sample,
using word = microsoft.office; object omissing = system.reflection.missing.value; object oendofdoc = "\\endofdoc"; /* \endofdoc predefined bookmark */ object otrue = true; object ofalse = false; //start word , create new document. word.interop.word.application oword = new word.interop.word.application(); word.interop.word.document odoc; oword.visible = true; //using template format of existing word doc object otemplate = "c:\\mytemplate.dotx"; odoc = oword.documents.add(ref otemplate, ref omissing, ref omissing, ref omissing); //get bookmark location template document word.interop.word.table wtbl = odoc.bookmarks.get_item("test").range.tables[1];
while runing through iis odoc coming null , checked oword
object coming system._comobject
.but incase development environment oword object coming microsoft.office.interop.word
, working perfectly.
c# asp.net ms-word
No comments:
Post a Comment