A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to forcibly kill the word session?



 
 
Thread Tools Display Modes
  #1  
Old May 10th, 2004, 11:32 AM
Veena
external usenet poster
 
Posts: n/a
Default How to forcibly kill the word session?

Hi,
We have a VB program which opens word documents and data source and
performs mailmerge programmatically.
Whenever there is a problem with mailmerge (eg: some mergefields are
missing) the word session hangs.
Can you please tell me a method wherein i can forcible kill the word
session. I tried calling the Quit method on WordApplication object and
close method on the word docs which are open. Both the statements hang
as word itself has hanged.
How do i forcible kill the word session programmatically ....
Any help would be greatly appreciated.

Thanks & Regards,
Veena.
  #2  
Old May 10th, 2004, 12:02 PM
Graham Mayor
external usenet poster
 
Posts: n/a
Default How to forcibly kill the word session?

If you can find a way to forcibly kill Word using vba that is also hung, and
then manage to deal with all the problems created by orphaned temporary
files that crashing Word will leave behind and the possibility that
autorecover may or may not be active on the target machine, then that would
be a nifty piece of programming.

I would have thought a better approach would have been to error trap the
problems that are likely to occur so that it doesn't hang in the first
place. I suggest posting the errant part of the code in one of the vba
newsgroups with a request for how best to error trap that aspect of it.

--

Graham Mayor - Word MVP

Web site www.gmayor.com
Word MVP web site www.mvps.org/word




Veena wrote:
Hi,
We have a VB program which opens word documents and data source and
performs mailmerge programmatically.
Whenever there is a problem with mailmerge (eg: some mergefields are
missing) the word session hangs.
Can you please tell me a method wherein i can forcible kill the word
session. I tried calling the Quit method on WordApplication object and
close method on the word docs which are open. Both the statements hang
as word itself has hanged.
How do i forcible kill the word session programmatically ....
Any help would be greatly appreciated.

Thanks & Regards,
Veena.



  #3  
Old May 11th, 2004, 09:01 AM
Veena
external usenet poster
 
Posts: n/a
Default How to forcibly kill the word session?

Thank you for the suggestion Graham !!!
But, actually we are trying to cater to the generic scenario when word
hangs.
In a normal scenario ,after doing a mailmerge (programmatically), the
merged output document is produced and the subsequent mail merges go
through fine.
But, in some cases, the mail merge fails, eg,it pop-ups some dialogs,
like "Record and header delimiter" or "invalid merge field". These
dialogs require manual intervention but, programmatically it is
difficult to supress these dialogs, the reason being there are
multiple scenarios or worse still the WORD session itself is hidden.
Thus, i need a generic solution wherein, if the word hangs or is in a
inconsistent state, i can forcibly kill it, open a fresh session again
and continue the mailmerges.

Please advice!!
Thanks & Regards,
Veena.

"Graham Mayor" wrote in message ...
If you can find a way to forcibly kill Word using vba that is also hung, and
then manage to deal with all the problems created by orphaned temporary
files that crashing Word will leave behind and the possibility that
autorecover may or may not be active on the target machine, then that would
be a nifty piece of programming.

I would have thought a better approach would have been to error trap the
problems that are likely to occur so that it doesn't hang in the first
place. I suggest posting the errant part of the code in one of the vba
newsgroups with a request for how best to error trap that aspect of it.

--

Graham Mayor - Word MVP

Web site www.gmayor.com
Word MVP web site www.mvps.org/word




Veena wrote:
Hi,
We have a VB program which opens word documents and data source and
performs mailmerge programmatically.
Whenever there is a problem with mailmerge (eg: some mergefields are
missing) the word session hangs.
Can you please tell me a method wherein i can forcible kill the word
session. I tried calling the Quit method on WordApplication object and
close method on the word docs which are open. Both the statements hang
as word itself has hanged.
How do i forcible kill the word session programmatically ....
Any help would be greatly appreciated.

Thanks & Regards,
Veena.

  #4  
Old May 11th, 2004, 09:40 AM
Graham Mayor
external usenet poster
 
Posts: n/a
Default How to forcibly kill the word session?

Take a look at vba help for 'On Error Statement' which should cover your
requirements.

--

Graham Mayor - Word MVP

Web site www.gmayor.com
Word MVP web site www.mvps.org/word




Veena wrote:
Thank you for the suggestion Graham !!!
But, actually we are trying to cater to the generic scenario when word
hangs.
In a normal scenario ,after doing a mailmerge (programmatically), the
merged output document is produced and the subsequent mail merges go
through fine.
But, in some cases, the mail merge fails, eg,it pop-ups some dialogs,
like "Record and header delimiter" or "invalid merge field". These
dialogs require manual intervention but, programmatically it is
difficult to supress these dialogs, the reason being there are
multiple scenarios or worse still the WORD session itself is hidden.
Thus, i need a generic solution wherein, if the word hangs or is in a
inconsistent state, i can forcibly kill it, open a fresh session again
and continue the mailmerges.

Please advice!!
Thanks & Regards,
Veena.

"Graham Mayor" wrote in message
...
If you can find a way to forcibly kill Word using vba that is also
hung, and
then manage to deal with all the problems created by orphaned
temporary
files that crashing Word will leave behind and the possibility that
autorecover may or may not be active on the target machine, then
that would
be a nifty piece of programming.

I would have thought a better approach would have been to error trap
the
problems that are likely to occur so that it doesn't hang in the
first
place. I suggest posting the errant part of the code in one of the
vba
newsgroups with a request for how best to error trap that aspect of
it.

--

Graham Mayor - Word MVP

Web site www.gmayor.com
Word MVP web site www.mvps.org/word




Veena wrote:
Hi,
We have a VB program which opens word documents and data source and
performs mailmerge programmatically.
Whenever there is a problem with mailmerge (eg: some mergefields are
missing) the word session hangs.
Can you please tell me a method wherein i can forcible kill the word
session. I tried calling the Quit method on WordApplication object
and
close method on the word docs which are open. Both the statements
hang
as word itself has hanged.
How do i forcible kill the word session programmatically ....
Any help would be greatly appreciated.

Thanks & Regards,
Veena.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:16 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.