WdNoProtection - unprotect word document not working

  • Thread starter Thread starter Lance.Carter via AccessMonster.com
  • Start date Start date
L

Lance.Carter via AccessMonster.com

I have a word document with fields which i need to unprotect /edit/re-protect.
The code below always works okay from within Word.

In Access I get a message "Variable not defined" pointing at the '
WdNoProtection' enum (it's an enum right?)

If wdapp.objWord.Application.ActiveDocument.ProtectionType <> wdnoprotection
Then
wdapp.Application.ActiveDocument.Unprotect
End If

Of course i have a Reference to Word 10.0 but do i need more reference or do
i have to define a 'WdProtectionType'? I tried but Access thought i was
trying to create a 'user defined' type.

Thanks in advance.

Lance
 
Actually, it's just a value: the enum is WdProtectionType.

Check your references (Tools | References while you're in the VB Editor).
While I know you said you have a reference to Word 10.0, it's possible that
some other reference has become broken, which can cause problems with all of
the other references. Look for the word MISSING: in front of all of the
selected references.
 
Douglas,

Thanks for that...i have been working (i now find out) with Office 10.0
reference, now Word 10.0 so you're right, it was references. This solved
another problem i also had (now fixed) and so i've no doubt it will remedy
this one for me also.

Cheers,

Lance
 
Back
Top