Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / June 2006

Tip: Looking for answers? Try searching our database.

WdNoProtection - unprotect word document not working

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lance.Carter - 05 Jun 2006 16:17 GMT
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
Douglas J Steele - 05 Jun 2006 17:15 GMT
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.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> I have a word document with fields which i need to unprotect /edit/re-protect.
> The code below always works okay from within Word.
[quoted text clipped - 14 lines]
>
> Lance
Lance.Carter - 06 Jun 2006 11:26 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.