HELP with Interface

K

klav

We have a custom web-based application which passes data to Word and executes
a macro which does a lot of formatting and then displays the document in
print preview to the user.

I don't want the user to see the file until all the formatting is done and
the file is ready to be print previewed. I cannot seem to achieve this....no
matter what code I use (making Word invisible, the window invisible, the
window small, etc.) the file is briefly shown before all of the formatting
begins to take place and it makes for a very sloppy interface. Plus, I ran
into problems with making things invisible -- was getting sporadic errors and
problems so I removed that.

I would even be OK with displaying a form first telling the user the file is
being processed but I cannot get that to work smoothly either -- the darn
file is always visible.

Need help with this.....please answer quickly.....thanks.
 
P

Pat Garard

G'Day Klav,

Have you tried:-

Sub DoSomething()
Application.ScreenUpdating = False
:
'Something happens here, but changes are not displayed
:
Application.ScreenUpdating = True
End Sub

Word remains visible, but no Screen Updating occurs.
You must also arrange to set ScreenUpdating to True
in the event of the Macro halting due to an Error (i.e. in
your Error Trap).
 
K

klav

Thanks for the quick response. The data that is being passed to Word from
the web application is visible in a document as soon as Word starts -- in
other words, my macro is not opening the file, it's already opened and
displayed in "document1." The screenupdating command doesn't take effect
soon enough -- you still see the data.
 
P

Pat Garard

G'Day Klav,

I cannont 'see' your application, so it is not clear to me where
the Macro is called from.

If 'YOU' are starting Word (ie your Macro), then Start Word with
a startup switch such as :
(from help)
'/tTemplateName'
Start Word with a new document based on a template other than the
Normal template. Example: /tMyfax.dot
Note If the file name has spaces in it, enclose the complete name
in quotation marks - for example, /t"Elegant Report.dot"
(Put the code to suppress ScreenUpdating in the Document_New()
Procedure of the Template.)
OR
/mMacroName
Start Word and then run a specific macro. The /m switch also
prevents Word from running any AutoExec macros.
Example: /mSaleLead
(Put the code to suppress ScreenUpdating in the MacroName Proc
of the Normal Template.)
OR
combine these.
 

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