The following code as working under Word 2003, but when a pc got upgrade to Word 2007, I got a 'runtime 70 permission denied' error.
I find the below on Microsoft, but I think I'm an administrator on this machine. The error happens where I put **. Any help appreciated.
"You attempted to access the registry, but your user permissions don't include this type of registry access.
On 32-bit Microsoft Windows systems, a user must have the correct permissions for access to the system registry. Change your permissions or have them changed by the system administrator."
oApp.Documents.Open (Worddoc)
oApp.Visible = True
MsgBox vbCr & _
"Batch Names Report " & vbCr & _
"" & Request & ".doc opened. ", vbOKOnly, "DM Batch Names Opened"
Else
If WordIsRunning = False Then
** Set oApp = CreateObject("Word.application")
oApp.Documents.Open (Worddoc)
MsgBox vbCr & _
"Batch Names Report " & vbCr & _
"" & Request & ".doc opened. ", vbOKOnly, "Batch Names Opened"
oApp.Visible = True
If oApp.Documents.Count > 0 Then
For Each oDoc In oApp.Documents
If Searchfolder & oDoc = Worddoc Then
oApp.Documents(Request & "_Batchnames.doc").Activate
Exit Sub
End If
Next oDoc
End If
I find the below on Microsoft, but I think I'm an administrator on this machine. The error happens where I put **. Any help appreciated.
"You attempted to access the registry, but your user permissions don't include this type of registry access.
On 32-bit Microsoft Windows systems, a user must have the correct permissions for access to the system registry. Change your permissions or have them changed by the system administrator."
oApp.Documents.Open (Worddoc)
oApp.Visible = True
MsgBox vbCr & _
"Batch Names Report " & vbCr & _
"" & Request & ".doc opened. ", vbOKOnly, "DM Batch Names Opened"
Else
If WordIsRunning = False Then
** Set oApp = CreateObject("Word.application")
oApp.Documents.Open (Worddoc)
MsgBox vbCr & _
"Batch Names Report " & vbCr & _
"" & Request & ".doc opened. ", vbOKOnly, "Batch Names Opened"
oApp.Visible = True
If oApp.Documents.Count > 0 Then
For Each oDoc In oApp.Documents
If Searchfolder & oDoc = Worddoc Then
oApp.Documents(Request & "_Batchnames.doc").Activate
Exit Sub
End If
Next oDoc
End If