Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / May 2008

Tip: Looking for answers? Try searching our database.

word automation with asp.net (c#)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sgulciny@yahoo.com - 23 May 2008 13:52 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 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,

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.