Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Tue, 23 Sep 2008 08:10:01 -0700,    group: microsoft.public.word.vba.general        back       


How to close Word document in Open event?   
Hi all,

	I am using Word object model. I am trying to close the document in 
Document_Open event of Word applicationObject. Due to this, Word is crashing.

                Is there a way by which, we can verify the document opened 
by user and close it there (based on some condition)...? 

                Any pointers on the same would definately help.

Thanks,
~Anita
date: Tue, 23 Sep 2008 08:10:01 -0700   author:   Anita

RE: How to close Word document in Open event?   
Hi Anita,

You want to use an event procedure to perform an action which again triggers 
events. I've also tried to do so, but it didn't work, perhaps it can't work: 
the first event is still not completely processed, and the application seems 
to be not ready there to process Your command.
Your 'close' action must not be in the context of Document_Open. You could 
use a timer event and perform it there instead: that should work. Maybe You 
want to use the Document_Open to hide the document in the meantime.

Regards,
Manfred
date: Wed, 24 Sep 2008 00:04:01 -0700   author:   Manfred F

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us