Una famiglia di sistemi di gestione per database relazionali di Microsoft progettati per semplificare l'uso.
ciao Francesca,
non vedo alternative all'apertura di un'istanza di word, aggiungendo un nuovo document.
in un modulo pubblico :
Option Compare Database
Option Explicit
Public objAppl As Object
Public Function isWordRunnning() As Boolean
On Error Resume Next
Set objAppl = GetObject(, "Word.Application")
Err.Clear
If objAppl Is Nothing Then
Set objAppl = CreateObject("Word.Application")
objAppl.Visible = True
End If
If Err <> 0 Then
MsgBox "qualcosa non va...." & _
Err.Description, vbCritical, "Warning"
isWordRunnning = False
Else
isWordRunnning = True
End If
End Function
evento click di un command button :
Private Sub openMYDoc_Click()
If isWordRunnning Then
Dim wDod As Object
Const wDocT As String = "C:\pathModelloDiWotd"
Const WdDocN As String = "nomeTemplate.dotm"
Set wDod = objAppl.Documents.Open(wDocT & WdDocN)
End If
With wDod
.SaveAs FileName:=wDocT & "prova.doc", _
FileFormat:=1, _
AddToRecentFiles:=False
' .Close SaveChanges:=False
End With
Set wDod = Nothing
Set objAppl = Nothing
End Sub
non utilizzo il metodo qui dell'istanza ma setto l'oggetto objAppl a nothing, il documento di word resta aperto lo chiuderai in seguito alle modifiche che effettuerai..
prova a vedere se ti basta intanto questo...
ciao, Sandro.