asp.net and microsoft word

  • Thread starter Thread starter mark
  • Start date Start date
M

mark

is it possible to open / create word documents in word ?
eg open a document and replace text and print ? using asp and vb behind.
if so is there any tutorials anywhere ? (heh difficult searching using
google for asp / word.... !)

mark
 
mark said:
is it possible to open / create word documents in word ?
eg open a document and replace text and print ? using asp and vb behind.
if so is there any tutorials anywhere ? (heh difficult searching using
google for asp / word.... !)

mark

It *is* possible to access Word from an application (sorry, I have
no examples), but (when you are using asp.net) the printing will take
place on the server, not on the client!

Hans Kesting
 
Hans Kesting said:
It *is* possible to access Word from an application (sorry, I have
no examples), but (when you are using asp.net) the printing will take
place on the server, not on the client!

Hans Kesting
that wouldnt be too much of a problem, printers are networked, plus all the
documents are stored on the same server,
 
is it possible to open / create word documents in word ?
eg open a document and replace text and print ? using asp and vb behind.
if so is there any tutorials anywhere ? (heh difficult searching using
google for asp / word.... !)

Yes, this is theory possible. You can do things like this:

Dim WordApp As New Word.Application
Dim WordDoc As Word.Document
Set WordDoc = WordApp.Open FileName
....do find the replace...
WordDoc.Save

This is from the top of my head and the syntax/objects are probably wrong.
The Word object model is documented in MSDN.

That said, Word (in fact no part of Office) is *not* designed to be used as
a component from an application. It does work but you may run into lots of
quirks. We had a devil of a time controlling Word remotely from our VB6
application. Most of the problems revolve around the user opening up their
own copy of WINWORD.EXE at the same time and it doing weird things with the
VB6 applications own copy of WINWORD.EXE. In effect, if you're not careful,
your app ends up sharing the same core DLLs as the user launched copy of
WINWORD. The user they closes Word and *bang* it also closes your own
internal instance....

This is with the 2000 and XP flavours. I heard that with Office 2003 they
improved the situation.

You're in a server environment though so the chances of a user opening Word
in the same session are slim.

Cheers, Rob.
 
Back
Top