T
topcat
I have an AutoOpen macro attached to a user's Normal.dot. When the user opens
a special HTML document the macor identifies the original template the
doucment was based on from the HTML code and attempts to find the correct
template on the user's machine and attach it to the document in Word.
This has all been working fine for a long time until a particular user had
their machine "rebuilt" - I am not sure what this means as they are situated
remotely. However, now when they open any of these special HTML documents in
Word the document loads but the AutoOpen macro fails with "Runtime error:
5947 - Could not change document template". Debugging the macro identifies
the offending code as being :
oDoc.AttachedTemplate = v & "\" & sTemplateName
where v is the path to the template.
Obviously, something has changed on the user's machine which causes this
error but I am at a loss to understand what. Whatever I try on my system, I
cannot replicate the error - I have tried changing permissions on the HTML
file and the template file but this does not cause this specific error.
Deliberately creating a corrupt template file also causes a different error,
as does the template being missing altogether.
If anyone can point me in the right direction as to what circumstances can
cause this error to arise I would be most grateful.
a special HTML document the macor identifies the original template the
doucment was based on from the HTML code and attempts to find the correct
template on the user's machine and attach it to the document in Word.
This has all been working fine for a long time until a particular user had
their machine "rebuilt" - I am not sure what this means as they are situated
remotely. However, now when they open any of these special HTML documents in
Word the document loads but the AutoOpen macro fails with "Runtime error:
5947 - Could not change document template". Debugging the macro identifies
the offending code as being :
oDoc.AttachedTemplate = v & "\" & sTemplateName
where v is the path to the template.
Obviously, something has changed on the user's machine which causes this
error but I am at a loss to understand what. Whatever I try on my system, I
cannot replicate the error - I have tried changing permissions on the HTML
file and the template file but this does not cause this specific error.
Deliberately creating a corrupt template file also causes a different error,
as does the template being missing altogether.
If anyone can point me in the right direction as to what circumstances can
cause this error to arise I would be most grateful.