C
camilla
Hi
Can anyone help me why the template "Adressmall_DNV_Sweden.dot" dont be
correctly attached.
Teh msgbox is only to help me deug the code and when i step through the code
will not Adressmall_DNV_Sweden.dot came up in the msgbox.
Exactly the same code works fine in another template
Public Sub Main()
On Error Resume Next
Set vbProj = ActiveDocument.VBProject
vbProj.References.AddFromFile "C:\Mallar\Adressmall_DNV_Sweden.dot"
For x = 1 To Word.Templates.Count
If Templates(x).Name = "Adressmall_DNV_Sweden.dot" Then
num = x
Exit For
End If
MsgBox (Templates(x).Name)
Next x
frmMain.Show
End Sub
Can anyone help me why the template "Adressmall_DNV_Sweden.dot" dont be
correctly attached.
Teh msgbox is only to help me deug the code and when i step through the code
will not Adressmall_DNV_Sweden.dot came up in the msgbox.
Exactly the same code works fine in another template
Public Sub Main()
On Error Resume Next
Set vbProj = ActiveDocument.VBProject
vbProj.References.AddFromFile "C:\Mallar\Adressmall_DNV_Sweden.dot"
For x = 1 To Word.Templates.Count
If Templates(x).Name = "Adressmall_DNV_Sweden.dot" Then
num = x
Exit For
End If
MsgBox (Templates(x).Name)
Next x
frmMain.Show
End Sub