Hi Experts,
I am working on a word add-in in VB6 which is dependent on working with one document that must not change.
In the form_load section it has this code to set the activedocument in a way that cannot be changed:
If Application.Documents.Coun
t > 0 then
Set docBeingUsed = Application.ActiveDocument
Else
msgbox "A document must be open.", , "Error"
'may need to call terminate sub here?
Exit Sub
End If
But if the user decides to close the document half way through, the add-in is still open and just about anything causes an error.
What's the best way to manage that? I can do it through error checking, but I'd really prefer an event if it's possible. Any thoughts on the best way to handle this would be a great help.
Cheers,
PatternNut
Start Free Trial