WdNoProtection - unprotect word document not working

  • Thread starter Lance.Carter via AccessMonster.com
  • 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
 
D

Douglas J Steele

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.
 
L

Lance.Carter via AccessMonster.com

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top