Rhys666
Programmer
- May 20, 2003
- 1,106
I am writing a data exchange tool in asp.net (c#). I', looking to access data in csv or xml files or word 2000 documents. The first two are relatively simple but I'm strufggling a little on the Word 2000 interoperability.
I am using a text editor and command line compiler and have no choice but to do this as I do not have access to an IDE to reference a com object with that nice point, click and go functionality.
I've looked at the tlbimp and SDK sample but just don't seem to be getting it I'm afraid, (Monday morning brain-block?).
I can adapt the SDK Word Interop sample and use a bat file to create what I believe should be a Wrapper for Word called Word.dll, and successfully compile my application referencing the metadata from the word.dll
However, when i change my .cs files to reference interop services and the Word wrapper;
...I get the follwing compiler errors;
but all that is on these lines are my class declaration;
and control declarations
Anyone got any idea's?
Rhys
"When one burns one's bridges, what a very nice fire it makes" -- Dylan Thomas
"As to marriage or celibacy, let a man take the course he will. He will be sure to repent" -- Socrates
I am using a text editor and command line compiler and have no choice but to do this as I do not have access to an IDE to reference a com object with that nice point, click and go functionality.
I've looked at the tlbimp and SDK sample but just don't seem to be getting it I'm afraid, (Monday morning brain-block?).
I can adapt the SDK Word Interop sample and use a bat file to create what I believe should be a Wrapper for Word called Word.dll, and successfully compile my application referencing the metadata from the word.dll
Code:
tlbimp "%ProgramFiles%\Microsoft Office\Office\msword9.olb" /silent /out:Word.dll
IF NOT EXIST bin mkdir bin
%CORPATH%csc /t:library /out:bin\DataExchange.dll /r:System.dll /r:System.Web.dll /r:System.Xml.dll /r:System.Data.dll /r:Word.dll /optimize+ /recurse:*.cs
However, when i change my .cs files to reference interop services and the Word wrapper;
Code:
using System.Runtime.InteropServices;
using Word;
...I get the follwing compiler errors;
Default.cs(16,32): error CS0234: The type or namespace name 'Web' does not exist in the class or namespace 'Word.System' (are you missing an assembly reference?)
Default.cs(19,20): error CS0234: The type or namespace name 'Web' does not exist in the class or namespace 'Word.System' (are you missing an assembly reference?)
Default.cs(20,20): error CS0234: The type or namespace name 'Web' does not exist in the class or namespace 'Word.System' (are you missing an assembly reference?)
Default.cs(21,20): error CS0234: The type or namespace name 'Web' does not exist in the class or namespace 'Word.System' (are you missing an assembly reference?)
Default.cs(22,20): error CS0234: The type or namespace name 'Web' does not exist in the class or namespace 'Word.System' (are you missing an assembly reference?)
Default.cs(23,20): error CS0234: The type or namespace name 'Web' does not exist in the class or namespace 'Word.System' (are you missing an assembly reference?)
Default.cs(24,20): error CS0234: The type or namespace name 'Web' does not exist in the class or namespace 'Word.System' (are you missing an assembly reference?)
but all that is on these lines are my class declaration;
Code:
public class Default : System.Web.UI.Page
and control declarations
Code:
protected System.Web.UI.WebControls.Button btnGetData;
protected System.Web.UI.WebControls.Label XMLPending;
protected System.Web.UI.WebControls.Label DOCPending;
protected System.Web.UI.WebControls.Label CSVPending;
protected System.Web.UI.WebControls.Label upLoadFailed;
protected System.Web.UI.WebControls.Label upLoadCompleted;
Anyone got any idea's?
Rhys
"When one burns one's bridges, what a very nice fire it makes" -- Dylan Thomas
"As to marriage or celibacy, let a man take the course he will. He will be sure to repent" -- Socrates