Hi DPrometheus
Let's start with the thing I'm absolutely sure about:
When you use "IF NOT" you're asking about a boolean, but ActiveDocument is an object, not a value. Try something more like:
If Word.ActiveDocument Is Nothing Then
That means no object could be assigned to ActiveDocument (it doesn't exist).
This should, at least, get rid of the error messages you mention.
The only time I would expect to not have an ActiveDocument object is if there are no documents open. A safer way to test this might be
If wdApp.Documents.Count < 1 Then
Also, at a "professional" level, I'd try very hard to not work with the ActiveDocument object. My inclination would be to keep a collection of some kind of all documents in a particular instance. Monitor the DocumentOpen, NewDocument, DocumentClose and perhaps DocumentChange events so that my code always "knows" which document object (if any) is the current one. That would complicate things considerably, but the approach could help workaround some issues.