473,413 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Interop Word problem+ASP.NET page

Hi, i'm in desperate need of help to fix a problem that i have, the problem
is the following:
I have an ASP.NET aplication that to open an word template document, this
aplication is in C#(using .NET 1.1 and VS2003), i have register the office
interop DLL in the GAC an have also install the office program in the
machine, this is in a virtual machine that i use to make the development, on
the host machine i have the same interop DLL's and the office suite install,
use the .NET 2.0 and the VS2005 to create a test aplication that opens the
same template this code works fine, but the on in the virtual machine gives
me an error on this line " Document wordDoc = wordapp.Documents.Open(ref
testedoc,ref missing,ref missing,ref missing,ref missing,ref missing,ref
missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref
missing,ref missing,ref missing);" it says "The command is not available", i
don't know what the problem might be, but need to solve this problem ot
finish the project. Thanks in advance for any help provided, surely
appreciate it.

ApplicationClass wordapp = new ApplicationClass();
object missing = Missing.Value;
object testedoc = @"E:\My Documents\Visual Studio
2005\WebSites\webword\Politica-Plano.dot";
object documento = @"E:\My Documents\Visual Studio
2005\WebSites\webword\teste.doc";
Document wordDoc = wordapp.Documents.Open(ref testedoc,ref
missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref
missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref
missing,ref missing);
wordDoc.Activate();
wordapp.Selection.TypeText("ola isto é um teste");
wordapp.Selection.TypeParagraph();
ReplaceBookmark(wordDoc,"nomedocumento","Testando o documento com
bookmarks");
wordDoc.SaveAs(ref documento,ref missing,ref missing,ref missing,ref
missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref
missing,ref missing,ref missing,ref missing,ref missing,ref missing);
wordapp.Quit(ref missing,ref missing,ref missing);
Response.Clear();
Response.ContentType = "application/doc";
Response.AddHeader("Content-Disposition",
"attachment;filename=testedoc.doc;");
Response.WriteFile(documento.ToString());
Sep 5 '06 #1
3 1446
Maybe you have other version in the virtual machine, At www.microsoft.com
you can download the PIA (primary interop assemblies) to use interop on ms
office.

regards
daniel

"Hospital S.Sebastiao" <Hospital S.*********@discussions.microsoft.com>
wrote in message news:7F**********************************@microsof t.com...
Hi, i'm in desperate need of help to fix a problem that i have, the
problem
is the following:
I have an ASP.NET aplication that to open an word template document, this
aplication is in C#(using .NET 1.1 and VS2003), i have register the office
interop DLL in the GAC an have also install the office program in the
machine, this is in a virtual machine that i use to make the development,
on
the host machine i have the same interop DLL's and the office suite
install,
use the .NET 2.0 and the VS2005 to create a test aplication that opens the
same template this code works fine, but the on in the virtual machine
gives
me an error on this line " Document wordDoc = wordapp.Documents.Open(ref
testedoc,ref missing,ref missing,ref missing,ref missing,ref missing,ref
missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref
missing,ref missing,ref missing);" it says "The command is not available",
i
don't know what the problem might be, but need to solve this problem ot
finish the project. Thanks in advance for any help provided, surely
appreciate it.

ApplicationClass wordapp = new ApplicationClass();
object missing = Missing.Value;
object testedoc = @"E:\My Documents\Visual Studio
2005\WebSites\webword\Politica-Plano.dot";
object documento = @"E:\My Documents\Visual Studio
2005\WebSites\webword\teste.doc";
Document wordDoc = wordapp.Documents.Open(ref testedoc,ref
missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref
missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref
missing,ref missing);
wordDoc.Activate();
wordapp.Selection.TypeText("ola isto é um teste");
wordapp.Selection.TypeParagraph();
ReplaceBookmark(wordDoc,"nomedocumento","Testando o documento com
bookmarks");
wordDoc.SaveAs(ref documento,ref missing,ref missing,ref
missing,ref
missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref
missing,ref missing,ref missing,ref missing,ref missing,ref missing);
wordapp.Quit(ref missing,ref missing,ref missing);
Response.Clear();
Response.ContentType = "application/doc";
Response.AddHeader("Content-Disposition",
"attachment;filename=testedoc.doc;");
Response.WriteFile(documento.ToString());

Sep 6 '06 #2
They are the same, as is the office version

"daniel #" wrote:
Maybe you have other version in the virtual machine, At www.microsoft.com
you can download the PIA (primary interop assemblies) to use interop on ms
office.

regards
daniel

"Hospital S.Sebastiao" <Hospital S.*********@discussions.microsoft.com>
wrote in message news:7F**********************************@microsof t.com...
Hi, i'm in desperate need of help to fix a problem that i have, the
problem
is the following:
I have an ASP.NET aplication that to open an word template document, this
aplication is in C#(using .NET 1.1 and VS2003), i have register the office
interop DLL in the GAC an have also install the office program in the
machine, this is in a virtual machine that i use to make the development,
on
the host machine i have the same interop DLL's and the office suite
install,
use the .NET 2.0 and the VS2005 to create a test aplication that opens the
same template this code works fine, but the on in the virtual machine
gives
me an error on this line " Document wordDoc = wordapp.Documents.Open(ref
testedoc,ref missing,ref missing,ref missing,ref missing,ref missing,ref
missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref
missing,ref missing,ref missing);" it says "The command is not available",
i
don't know what the problem might be, but need to solve this problem ot
finish the project. Thanks in advance for any help provided, surely
appreciate it.

ApplicationClass wordapp = new ApplicationClass();
object missing = Missing.Value;
object testedoc = @"E:\My Documents\Visual Studio
2005\WebSites\webword\Politica-Plano.dot";
object documento = @"E:\My Documents\Visual Studio
2005\WebSites\webword\teste.doc";
Document wordDoc = wordapp.Documents.Open(ref testedoc,ref
missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref
missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref
missing,ref missing);
wordDoc.Activate();
wordapp.Selection.TypeText("ola isto é um teste");
wordapp.Selection.TypeParagraph();
ReplaceBookmark(wordDoc,"nomedocumento","Testando o documento com
bookmarks");
wordDoc.SaveAs(ref documento,ref missing,ref missing,ref
missing,ref
missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref
missing,ref missing,ref missing,ref missing,ref missing,ref missing);
wordapp.Quit(ref missing,ref missing,ref missing);
Response.Clear();
Response.ContentType = "application/doc";
Response.AddHeader("Content-Disposition",
"attachment;filename=testedoc.doc;");
Response.WriteFile(documento.ToString());


Sep 6 '06 #3
Hey this is very funny i'm having the same problem.

Exactly like yours i'm trying to open Word on Virtual PC. I'm using
Asp.net 2.0 ( vb.net)
This was working fine yesterday and all of a sudden is not working. It
tells me "This command is not available" I know very well is not my
code cause it was working fine yesterday...Ooh one other thing my MS
Office is not activated. So i am going to activate this and see where
this takes me

Sep 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Graeme Wood | last post by:
I have an ASP page hosted on a windows 2003 server. This page was working fine until Saturday. Now, the server doesn't serve it and gives a 404 page not found error. The file DEFINITELY exists...
1
by: CJM | last post by:
I'm working on an ASP application on my XP m/c. I've uploaded a copy of the ASP code and accompanying DB onto another server that is running both IIS5 & SQL Server. This is so that the...
0
by: CJM | last post by:
I'm working on an ASP application on my XP m/c. I've uploaded a copy of the ASP code and accompanying DB onto another server that is running both IIS5 & SQL Server. This is so that the...
10
by: Don Munroe | last post by:
This one has me stumped. I have three web applications running on two different servers. The first that works fine is hosted by a .Net hosting company. Everyone that uses it has no problems...
6
by: Dave | last post by:
This is such a "dead in the water" problem I don't even know if this is the right forum for it. I have developed an ASP.NET/C# project on my own PC and it's working. I then transferred it to the...
0
by: Rami Salner | last post by:
Hi! I need to parse an XML with info about programs and show a diagram about these programs in my form. Getting the info about the programs was easy. But I have problem with showing the diagram in...
0
by: A.J. van der Burg | last post by:
Hi all, I have a serious problem with asp.net validation: I developed a custom validation summary control, which will lookup error messages from an external source based on the...
2
by: rawCoder | last post by:
Hi, I have a case where my application built in Visual STudio .NET 2003 and ASP.NET ( VB/C# ) is installed on IIS 6.0, windows server 2003. Problem is that when I reach the site( using IE)...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
agi2029
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.