J
Jules
I am trying to create NewDoc using encrypted WorkGroupTemplates - below code
works for Word documents not encrypted.
***Code between asterisks courtesy of Greg Maxey
Sub NewDoc(pName As String)
Documents.Add Template:=Path & pName
End Sub
Function Path() As String
Path = Application.Options.DefaultFilePath(wdWorkGroupTemplatesPath)
Path = Path & "\"
End Function
***
I am trying to alter code below - but in line 3 the word "Template" is
highlighted Named Argument Error (Break Mode)
Any suggestions on how to make this work with encrypted (password) files
please? It's way over my skill level without help.
1 Public Sub NewDoc(pName As String) 'Because it says NewDoc is that a
problem?
2 Dim Temp As Document
3 Set Temp = Documents.Open(Template:=Path & pName,
PasswordDocument:="1234", Visible:=False)
Documents.Add Template:=Path & pName
Temp.Close
End Sub
Function Path() As String
Path = Application.Options.DefaultFilePath(wdWorkgroupTemplatesPath)
Path = Path & "\"
End Function
Many thanks.
works for Word documents not encrypted.
***Code between asterisks courtesy of Greg Maxey
Sub NewDoc(pName As String)
Documents.Add Template:=Path & pName
End Sub
Function Path() As String
Path = Application.Options.DefaultFilePath(wdWorkGroupTemplatesPath)
Path = Path & "\"
End Function
***
I am trying to alter code below - but in line 3 the word "Template" is
highlighted Named Argument Error (Break Mode)
Any suggestions on how to make this work with encrypted (password) files
please? It's way over my skill level without help.
1 Public Sub NewDoc(pName As String) 'Because it says NewDoc is that a
problem?
2 Dim Temp As Document
3 Set Temp = Documents.Open(Template:=Path & pName,
PasswordDocument:="1234", Visible:=False)
Documents.Add Template:=Path & pName
Temp.Close
End Sub
Function Path() As String
Path = Application.Options.DefaultFilePath(wdWorkgroupTemplatesPath)
Path = Path & "\"
End Function
Many thanks.