Thanks for your advice, John. I've gotten the following to work:
My form has bound object frame named bofTemplate
Command button code:
'''''''''''''''''''''''''''''
Private Sub cmdLaunch_Click()
'Launches an embedded Word document, saves a copy to a file, and closes Word
Dim oApp As Word.Application
Dim oDoc As Word.Document
'Open the object in its own application - MS Word in this case
Me.bofTemplate.Verb = acOLEVerbOpen
Me.bofTemplate.Action = acOLEActivate
'set a pointer to the application to allow automation -- kind of kludgy if
Word is already running
Set oApp = GetObject(, "Word.Application")
oApp.Visible = False
'set the document variable to the highest numbered Word doc - kludge!
Set oDoc = oApp.Documents(oApp.Documents.Count)
oDoc.SaveAs "C:\once embedded template.dot"
oDoc.Close False
oApp.Quit False
Set oDoc = Nothing
Set oApp = Nothing
End Sub
'''''''''''''''''''''''
I can see how problems could arrise if Word were already open with a bunch
of documents open. I can't come up with a more precise way of getting a
more precise handle to the application/document spawned by openning the
embedded document. Any how, this works for the time being. Thanks,
Kevin