|
-
Sep 3rd, 2002, 03:58 AM
#1
Thread Starter
Member
Starting and quitting Word programmatically
-
Sep 3rd, 2002, 08:13 AM
#2
Addicted Member
You need to use early binding. Put a reference to the word object model in your project.
Dim oApp As New Word.Application()
oApp.Visible = True
oApp.Documents.Open("c:\test.doc")
oApp.Documents.Close()
Wind and waves resolves all problems.
-
Sep 3rd, 2002, 08:27 AM
#3
Thread Starter
Member
not able to set visible to true
Unfortunately I still can't set .Visible tot true.
The code I use is the following:
Code:
Dim oWord As New Word.Application()
<WebMethod()> Public Function PrintKlant() As String
oWord.Visible = True
oWord.Documents.Add("H:\Test.dot", , , True)
oWord.Application.ActiveDocument.PrintPreview()
'oWord.Quit()
End Function
ALthough I set .Visible to true, it stays False.
And I stil get the ambiguous warning for the quit statment.
-
Sep 4th, 2002, 03:01 AM
#4
Addicted Member
Unless things have changed drastically you can't execute an exe from a web page, which includes a webmethod. Webservices are purely for generating xml. The code works fine in vb.net but will not work in asp.net. As far as i'm aware what your doing is a no go.
Wind and waves resolves all problems.
-
Sep 5th, 2002, 04:23 AM
#5
Thread Starter
Member
-
Sep 5th, 2002, 05:30 AM
#6
Thread Starter
Member
Found part of the problem
The quit statement seems to have a bug in .NET;
More on this at microsoft:
support.microsoft.com/default.aspx?scid=KB;EN-US;Q315981&
This leaves me with just 1 problem: How do I make Word visible
Thanx for the help though,
Dozo
-
Sep 5th, 2002, 04:27 PM
#7
Addicted Member
Dozo,
I have the exact same problem. Found a solution yet?
-
Sep 6th, 2002, 05:01 AM
#8
Thread Starter
Member
No
Haven't found it yet...
Word does start. However, since I am not able to make it visible does anyone know how to imbed word in an aspx page??
Maybe that is a solution...
Dozo
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|