Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Conversions / October 2007

Tip: Looking for answers? Try searching our database.

Question for Graham Mayor

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve Schroeder - 15 Oct 2007 18:51 GMT
I recently downloaded your script for the Toggle Objects Word 2007 add in,
and it works perfect, thanks.

My question is, is it possible to use this macro while protecting the
document at the same time.  My client wants the document protected for easy
tabbing through the content controls, but I get errors then when trying to
check the boxes.  Is there something I can do to tell word to let this run ?
Graham Mayor - 16 Oct 2007 05:34 GMT
Do I have a Toggle Objects for Word 2007 add-in?
Do you mean - the check box method at http://www.gmayor.com/Macrobutton.htm 
?
Why not use the check box form field available from the controls section
>legacy controls on the Developer tab of the ribbon? However if you add the
code to lock and unlock the form the macrobutton code will work in a
protected form

Sub CheckIt()
Dim bProtected As Boolean
'Unprotect the file
If ActiveDocument.ProtectionType <> wdNoProtection Then
 bProtected = True
 ActiveDocument.Unprotect Password:=""
End If
NormalTemplate.BuildingBlockEntries("Checked Box").Insert _
Where:=Selection.Range
'Reprotect the document.
If bProtected = True Then
 ActiveDocument.Protect _
 Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=""
End If
End Sub

Sub UncheckIt()
Dim bProtected As Boolean
'Unprotect the file
If ActiveDocument.ProtectionType <> wdNoProtection Then
 bProtected = True
 ActiveDocument.Unprotect Password:=""
End If
NormalTemplate.BuildingBlockEntries("Unchecked Box").Insert _
Where:=Selection.Range
'Reprotect the document.
If bProtected = True Then
 ActiveDocument.Protect _
 Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=""
End If
End Sub

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> I recently downloaded your script for the Toggle Objects Word 2007
> add in, and it works perfect, thanks.
[quoted text clipped - 4 lines]
> when trying to check the boxes.  Is there something I can do to tell
> word to let this run ?
Steve Schroeder - 16 Oct 2007 16:26 GMT
Im sorry,. saw you link to this site from someone else thought it was yours,
lol.   http://gregmaxey.mvps.org/Add_Toggle_Objects.htm  That is the add in
im using, we have about 3000 documents using Content Controls and .docx
format now, its to my understanding that legacy controls will not work in a
.docx format. I will try the code you entered but as I have no programming
background might be a bit difficult.  If you have any other ideas or
suggestions would be appreciated, thanks for the help.
> Do I have a Toggle Objects for Word 2007 add-in?
> Do you mean - the check box method at
[quoted text clipped - 45 lines]
>> when trying to check the boxes.  Is there something I can do to tell
>> word to let this run ?
Graham Mayor - 18 Oct 2007 05:14 GMT
The legacy controls work just as they did in earlier versions.

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> Im sorry,. saw you link to this site from someone else thought it was
> yours, lol.   http://gregmaxey.mvps.org/Add_Toggle_Objects.htm  That
[quoted text clipped - 61 lines]
>>> errors then when trying to check the boxes.  Is there something I
>>> can do to tell word to let this run ?
 
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.