Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Word 2K3 in the background 1

Status
Not open for further replies.

Casbah

Programmer
May 18, 2004
31
IE
I have a program that makes a call to Word, opens it, does some stuff, closes it all automatically. In Word97 everything gets performed in the background and this is wat i want. Trouble is I need to run this on Word 2K3 too and this brings Word to the fore and makes it visible to the user. I dont want this. Is there a setting somewhere or sometrhing to change this?
Thanks,
Conor
 
Yes.

Dim wrd as Application
Set wrd = GetObject(, "Word.Application")
wrd.Visible = False

Remember:

1. at some point, when you do not need it anymore, release the instance of Word with, Set wrd = Nothing

2. Depending on your needs, be careful of scope. If this is something you may need on and off through your code, then the variable wrd should be declared public in the module, rather than in a sub.

It is also possible that what you want is:

Application.ScreenUpdating = False

Use the first if you want all of Word to be invisible. Use the second if you want the changes happening to be invisible. If you use screen updating, make sure that when you are done to turn it back on again.

Gerry
 
i know this is a silly but where exactly would i put the code u posted?
 
Sorry, I saw the Programmer after your name and didn't want to overexplain.

You do not state from where you are making the call to Word. Clearly you must have an instruction to do that, correct? Are you calling from another Office app? You state you have "a program that makes a call to Word". What program? You do not state exactly how you are currently making that call.

If you post what you have perhaps I could help with more specifics.

Nevertheless, as a general answer to your question, replace the procedure you are using to call up Word, with the above, which calls up Word as an object. Objects can be visible, or not.


Gerry
 
sorry gerry my 2nd question was pretty silly. but heres the dilly. i call it from a seperate program altogether using the WinExec command. Now this program has already been built and athough I realise I could change the params passed to WinExec (SHOWALL)etc this would be far too big a change to implement, as it would mean I would have to rebuild the prog and reinstall everywhere.

Now I tried putting your code into my macros in word itself but that doesnt do the job either, even tho im running the macro straight away (winword file.doc "macro") word still comes up to the fore.

Writing the autoExec macro and giving it your code will work but then it will happen even with manual calls to word, and again this is something i dont want happening. is there a way of writing a macro local to a file that will do wat i want automaticlly?
Thanks, Conor
 
ok i have it almost working now. everything thats happening within the file is hidden which is wat i want. only thing left is the word 2k3 screen that still comes up. u know when u open up word like an info screen pops up every time. is it possible to get rid of that? or hide it like the rest?
 
There is another thread that asked the same thing. So far....no, I can not make the splash screen go away. It is probably built right into the Word executable.


Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top