Is it possible to create object "Document" directly but Object "Application"?

F

Frank

Hi, all

As known that startup a word application is too slow.
I find there are some keys in regstry for type library, for example
"Word.Document.6""Word.Document.8"...so, I think it may be possible to
create object Document dirtectly but Object Application.

Please tell me if it is a impossible idea...
Thanx very much for ur time

Any help is appreciated!

:-]
--
Frank F.Han

+-----------------------------------------+
| (e-mail address removed) |
+-----------------------------------------+
 
C

Cindy M -WordMVP-

Hi Frank,
As known that startup a word application is too slow.
I find there are some keys in regstry for type library, for example
"Word.Document.6""Word.Document.8"...so, I think it may be possible to
create object Document dirtectly but Object Application.

Please tell me if it is a impossible idea...
It's an impossible idea, as it stands. You need to use the Word
application to create a Word document, unless:

If you're using something like C++ you can create a Word document as a
binary file. But you have to get the binary file format (BIFF) from
Microsoft.

You can research how Word interprets HTML, generate an HTML file (as
plain text).

Or, if you can use Word 2003 to open what you create, you can create a
Word file using the WordML language.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
P

Paul Stubbs [MS]

Hi Frank,

Cindy is correct there are other ways to create Word documents without
starting Word. They are more complicated to implement. If you are just
looking for a speed boost then you can start Word once then all others can
just get the currently running instance of Word. This is musch faster than
opening and closing the Word Application each time. Here is a sample VB.NET
application showing you how. You will need to add a reference to the
Microsoft Word 11.0 object library

Imports Word = Microsoft.Office.Interop.Word



Public Class Form1

Inherits System.Windows.Forms.Form



Private Sub CreateNewWordProcess_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click

Dim wordApp As Word.Application

'Start a new word Process

wordApp = CreateObject("Word.Application")

wordApp.Visible = True

wordApp.Documents.Add()



End Sub



Private Sub AttachToExistingWordProcess_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Dim wordApp As Word.Application

'assume Word process is already running

wordApp = GetObject(, "Word.Application")

wordApp.Visible = True

wordApp.Documents.Add()

End Sub

End Class



Thanks
Paul Stubbs
VSTO Program Manager
 
F

Francis Dion

Hi,

If your objective is to create Word documents very rapidly, you should
check out XpertDoc. It can literally create hundreds of genuine
MS-Word documents per seconds.

You can download a demo from the web site: www.xpertdoc.com

Regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top