D
dwien
Hi,
If I use the automation code below, then the vba code (code in thisdocument,
modules and classes) is copied in the new document generated.
I did the check to open the document on an other computer that doesn't have
the template on his harddrive and there you can see the complete code, too.
How can I avoid that hte code is embedded inside the new generated document.
Thanks
Edwin
Private Sub test()
Dim oWordApp As Word.Application
Dim oWordDoc As Word.Document
Set oWordApp = GetObject(, "Word.Application")
If Err <> 0 Then
Set oWordApp = CreateObject("Word.Application")
End If
With oWordApp
Set oWordDoc = .Documents.Add("c:\test\template.dot")
With oWordDoc
.Generatetest 1, 1
End With
End With
Set oWordDoc = Nothing
Set oWordApp = Nothing
End Sub
If I use the automation code below, then the vba code (code in thisdocument,
modules and classes) is copied in the new document generated.
I did the check to open the document on an other computer that doesn't have
the template on his harddrive and there you can see the complete code, too.
How can I avoid that hte code is embedded inside the new generated document.
Thanks
Edwin
Private Sub test()
Dim oWordApp As Word.Application
Dim oWordDoc As Word.Document
Set oWordApp = GetObject(, "Word.Application")
If Err <> 0 Then
Set oWordApp = CreateObject("Word.Application")
End If
With oWordApp
Set oWordDoc = .Documents.Add("c:\test\template.dot")
With oWordDoc
.Generatetest 1, 1
End With
End With
Set oWordDoc = Nothing
Set oWordApp = Nothing
End Sub