> Obviously I have Word set to the (more or less) equivalent of classic MDI,
> each instance in its own window.
If you´ve coded correctly, you can quit each object variable pointing to a
newly created
Word instance seperately.
This is a sequence within Word VBA (!) examplifying object orientated coding
in which
each instance can be addressed seperately and in yr case: killed seperately:
(actually a bit of "inter appliation" automation ... oops that didn't sound
too good, now did it? ....)
Dim Inst1 As New Word.Application
Dim Inst2 As New Word.Application
Dim Doc1 As Document
Dim Doc2 As Document
Inst1.Visible = True
Inst2.Visible = True
Set Doc1 = Inst1.Documents.Add
Set Doc2 = Inst2.Documents.Add
Doc1.Windows(1).Visible = True
Doc2.Windows(1).Visible = True
Doc1.Range(0, 0).InsertAfter "text in doc1"
Doc2.Range(0, 0).InsertAfter "text in doc2"
Doc1.Close 0
Inst1.Quit: Set Inst1 = Nothing
'Now all actions of Inst1 are processed, leaving you Inst2 with document and
the text to proof this.
' Note: all other previsouly instances of Word should be intact as well !
--
Krgrds,
Perry
System:
Vista/Office Ultimate
VS2005/VSTO2005 SE
> Hi,
>
[quoted text clipped - 15 lines]
> Thanks and BW,
> p.
Paul B - 11 Mar 2007 16:54 GMT
>> Obviously I have Word set to the (more or less) equivalent of classic MDI,
>> each instance in its own window.
[quoted text clipped - 32 lines]
> the text to proof this.
> ' Note: all other previsouly instances of Word should be intact as well !
Thanks, Perry. Definitely a keeper for its depth of insight.
I thought I figured out an easy way to do what I need via SendKeys:
Sub SaveClose()
' Save and Close doc NOW; 03/10/07
ActiveDocument.Close savechanges:=wdSaveChanges
SendKeys "%{f4}"
End Sub
However I then noticed a strange side effect - executing the macro turns
off NumLock! Bizarre.
I'll try later to see if I can salvage my idea or incorporate yours.
Thanks and BW,
p.
I believe ...
Application.Quit
... is probably the line of code you are looking for.

Signature
Enjoy,
Tony
> Hi,
>
[quoted text clipped - 15 lines]
> Thanks and BW,
> p.
Paul B - 18 Mar 2007 20:44 GMT
> I believe ...
>
> Application.Quit
>
> ... is probably the line of code you are looking for.
That is perfect. Thanks much.
paul

Signature
Using Office 2003 on Windows XP Home