Hi ,
I have write the following code to open word document on server - using Microsoft.Office.Interop.Word;
-
-
string DocPath = System.Configuration.ConfigurationManager.AppSettings["VirtualDocPath"];
-
-
ApplicationClass wordApp = new ApplicationClass();
-
string filePath = "";
-
filePath = DocPath + Session["username"] + "/" + DocFile.Value.ToString();
-
lblPath.Text = Server.MapPath("~/Document/" + Session["username"]) + "/" + DocFile.Value.ToString();
-
object file = filePath;
-
object readOnly = false;
-
object isVisible = true;
-
object nullobj = System.Reflection.Missing.Value;
-
wordApp.Visible = false;
-
-
// here on Document.Open there should be 9 arg.
-
//Word.Document doc = new Document();
-
//Microsoft.Office.Interop.Word.Document doc;
-
-
Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.Open(ref file,
-
ref nullobj, ref readOnly, ref nullobj, ref nullobj, ref nullobj,
-
ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj,
-
ref isVisible, ref nullobj, ref nullobj, ref nullobj, ref nullobj);
-
-
-
// Here the word content is copeied into a string which helps to
-
// store it into textbox.
-
Microsoft.Office.Interop.Word.Document doc1 = wordApp.ActiveDocument;
-
-
string m_Content = doc1.Content.Text;
-
-
// the content is stored into the textbox.
-
if (sMode.Trim() == "ReadOnly")
-
{
-
txtdocument.ReadOnly = true;
-
btnSave.Visible = false;
-
btnEsign.Visible = false;
-
}
-
-
txtdocument.Text = m_Content;
-
doc.Close(ref nullobj, ref nullobj, ref nullobj);
This code is working fine on my local machine ond other local machine where Microsoft office 2007 is installed
but on my server I'm getting the following
Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005
Can anyone give me solution of this error.
Thanks in advance
Saket
2 4425 Frinavale 9,735
Recognized Expert Moderator Expert
Is Microsoft office 2007 installed on the server?
i got the solution finally.
I have just given the full rights to the aspnet user on server to that particular folder where I have to keep my documents.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Josh Asbury |
last post by:
Hi all -
I am having troubles with implementing a CommandBar in Microsoft Word
utilizing VB.net. My CommandBar appears when I start Word, but if I open an
existing document, it does not appear. My best guess is that ActiveDocument
isn't getting set correctly, but I really don't know how else to implement
this. I am attaching an external template to avoid making any changes to
Normal.dot, but my code generates the CommandBar. I have...
|
by: senthilavs |
last post by:
Hi,
Im having word document in the Server Machine. While im trying to open the file in Client Machine file is opening in Server only. I need to open in the client only. This is an ASP.NET project done in VB.NET.
The Code i used to Open the file
---------------------------------------------
Dim oWordApplic As New Word.ApplicationClass
Dim oDoc As Word.Document
Dim strFileName As String =...
|
by: fab |
last post by:
Hi,
I'm developping a web-application on an intranet.
I've got a datagrid with a button on each line. Each line represents a
document (MS Word doc). These documents are on a share so that they
can be saved directly on the file server.
When i click on this button, it opens another windows with the word
document linked to the line.
But this document is open into the browser ; so i'd like the document
|
by: Niyazi |
last post by:
Hi,
I created application that store the data in SQL SERVER that reside on
network. The client also use this application to access the resources
provided with application. But is the client want to register new customer or
companies they will enter the information in Windows Form and the program
automaticaly creates the WORD document under specific folder under
application path. Once the empty word file created than ask user if they want...
|
by: jefftim |
last post by:
Hi All
I've saved a word document in sql server database.I'm able to retrieve
it from the database and open it in a word application.
My problem is I'm able to open it in server/client machines if the
operating system is win2000 but when i'm opening it in windows(XP/2003)
it is saying that document not found.
please try to solve my problem asap.
| |
by: iwdu15 |
last post by:
hi, how can i get the icon associated with a certain file type? thanks
--
-iwdu15
|
by: gusa992000 |
last post by:
Hello
I am trying the following problem:
A web app in jsp and java has to open a microsoft word document directly in the browser. This part is easy and i have done it.
The user then can modify the word document.
If the user 'save' the document (using the Save button of the MS tool bar in the browser) the application has to 'save as' the document on the server, not over writing the openned file but creating a new one.
|
by: questionit |
last post by:
Hi all
I have Win Xp installed in one partition and Windows Server 2003 in another partition.
I have opened a Word document in Windows Server and when i tried to open the same document from Windows Xp , i got message that this document will open read-only or i have to save the docuemnt with another name if i want to write on it
Similarly, from XP, when i try to perform some other tasks like connecting to internet, etc i get a message...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |