Hi friends,I have a problem about word and asp.net .
When I run my project in visual web developer 2005 it works fine. But
in server it is not work. I think its about secury settings. What can
I do to call word document from server to client???
Here is my code
*************************************
object readOnly = false;
object isVisible = true;
object missing = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word.ApplicationClass oWordApp = new
Microsoft.Office.Interop.Word.ApplicationClass();
object oTemplate = @"C:\Inetpub\wwwroot\templates\request.dot";
Microsoft.Office.Interop.Word.Document oWordDoc =
oWordApp.Documents.Add(ref oTemplate, ref missing, ref missing, ref
isVisible);
oWordDoc.Activate();
object oBookMark = "FirmName";
oWordDoc.Bookmarks.get_Item(ref oBookMark).Range.Text = "bla
blaaa";
oWordApp.Visible = true;
and here is error in server
**********************************
System.NullReferenceException in oWordDoc.Activate();
Thanks for all.............
Mark Rae [MVP] - 23 May 2008 14:33 GMT
> Hi friends,I have a problem about word and asp.net .
> When I run my project in visual web developer 2005 it works fine. But
> in server it is not work. I think its about security settings.
Server-side Office automation is neither recommended nor supported by
Microsoft because it cannot be guaranteed to work properly (as you've
discovered) and, in some cases, can cause serious problems leading to data
loss:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2
http://support.microsoft.com/default.aspx/kb/288367
> What can I do to call word document from server to client???
http://www.aspose.com/categories/file-format-components/aspose.words-for-.net-an
d-java/default.aspx

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
Cubaman - 26 May 2008 19:00 GMT
On May 23, 2:52 pm, sgulc...@yahoo.com wrote:
> Hi friends,I have a problem about word and asp.net .
> When I run my project in visual web developer 2005 it works fine. But
[quoted text clipped - 27 lines]
>
> Thanks for all.............
Hello:
With the new officce version, a workaround would be to manipulate the
xml representation of the document as xml.
Just save the original doc as xml and the you can manipulate it with
xsl or loading a dom.
Best regards,