Open Hiden Word Application with VB Shell Command

J

jamie

To anyone who can help:

Situation:
I am opening word, in VB, with the shell command. The reason being, I
wish to take advaantage of the Word Swtichs (http://
support.microsoft.com/kb/210565) for greater effieciency in opening.

Background:
I am using the following:

iRet=Shell(FileName, vbHide)
Set wApp = GetObject(, "Word.application")
wApp.Visible = False 'Open blank document
Set wDoc0 = wApp.Documents.Item(sWDocumentName_SolHeadTemplate)

.... Do stuff to wDoc0 ...

Issue:
The issue is, when Shell is called, Word is open for some time untill
wApp.visible=False. Thus, how does one open Word, with Shell, and
force the launched application to stay hidden?

Thanks in advance!!!
 
F

Family Tree Mike

jamie said:
To anyone who can help:

Situation:
I am opening word, in VB, with the shell command. The reason being, I
wish to take advaantage of the Word Swtichs (http://
support.microsoft.com/kb/210565) for greater effieciency in opening.

Background:
I am using the following:

iRet=Shell(FileName, vbHide)
Set wApp = GetObject(, "Word.application")
wApp.Visible = False 'Open blank document
Set wDoc0 = wApp.Documents.Item(sWDocumentName_SolHeadTemplate)

.... Do stuff to wDoc0 ...

Issue:
The issue is, when Shell is called, Word is open for some time untill
wApp.visible=False. Thus, how does one open Word, with Shell, and
force the launched application to stay hidden?

Thanks in advance!!!

Are you sure you cannot do the equivalent with the application object that
you wish to do with command line arguments? You can easily create an
instance of the application and change things before making it visible.
 
J

jamie

Presently, I am using an calling an instance, late bound, of MS Word.
However, I would like to speed up the time it takes to open the
Word.Application object. After researching, I have found that opening
word with switches will speed up the time in which Word is open.The
only way to open word with switches is via cmd prompt, or for VB the
shell command.

The tradeoff is the application visilbly opens, after being called by
the Shell command. I can then use a getobj statement to capture this
object, and then hide it. My hope is there is an API, or some instance
of the SHELLEXC API to open Word without being visbile......
 

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