Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / July 2005

Tip: Looking for answers? Try searching our database.

HELP with Interface

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
klav - 06 Jul 2005 21:12 GMT
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.
Pat Garard - 06 Jul 2005 22:13 GMT
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).
Signature

Regards,
Pat Garard
Melbourne, Australia
_______________________

> We have a custom web-based application which passes data to Word and
> executes
[quoted text clipped - 23 lines]
>
> Need help with this.....please answer quickly.....thanks.
klav - 07 Jul 2005 12:35 GMT
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.

> G'Day Klav,
>
[quoted text clipped - 39 lines]
> >
> > Need help with this.....please answer quickly.....thanks.
Pat Garard - 07 Jul 2005 22:20 GMT
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.
Signature

Regards,
Pat Garard
Melbourne, Australia
_______________________

> Thanks for the quick response.  The data that is being passed to
> Word from
[quoted text clipped - 54 lines]
>> >
>> > Need help with this.....please answer quickly.....thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.