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 / Programming / December 2004

Tip: Looking for answers? Try searching our database.

PgDn in protected section

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
peter - 17 Dec 2004 13:25 GMT
Hello,

I have this strange problem with MS Word XP, that I hope you can help me
with.

I have a document, that has a protected (for forms) section in the middle.
That section contains a number of (FormField) checkboxes.

Problem is: if a user PageDowns from the start of the doc,
PageDown works fine in the UNprotected sections,
but in the protected section travels from CheckBox to CheckBox
(eating up the Checked-status in the process).

What I planned to do is tweak PageDown:
to perform normally in unprotected sections,
but in protected sections jump out of that section.

So I devised the following macro:

Sub myPageDown()
'
MsgBox "PageDown"
    With Selection
        If .Sections(1).ProtectedForForms Then
           .GoToNext wdGoToSection
        Else
           .MoveDown Unit:=wdScreen, Count:=1
        End If
    End With
End Sub

It works fine in UNprotected sections.
It refuses to work in the protected section.

Question:
* How can I change the behaviour of PageDown (in a Protected section)?

regards,
peter
Jean-Guy Marcil - 17 Dec 2004 13:38 GMT
peter was telling us:
peter nous racontait que :

> Hello,
>
[quoted text clipped - 8 lines]
> but in the protected section travels from CheckBox to CheckBox
> (eating up the Checked-status in the process).

<snip>

> Question:
> * How can I change the behaviour of PageDown (in a Protected section)?

Have you tried unprotecting the section, jumping to the next one and
reprotecting it?
See Protect / Unprotect in the on-line VBA help.

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Aquarius - 17 Dec 2004 14:20 GMT
Jean-Guy,
BRILLIANT! Your remark is sooo simple; stupid I did not come up with it ;-)
(BTW: the protected section is 4)

   Sub myPageDown()

   MsgBox "PageDown"

   ActiveDocument.Sections(4).ProtectedForForms = False
   With Selection
       .MoveDown Unit:=wdScreen, Count:=1
       If .Sections(1).Index = 4 Then .GoToNext wdGoToSection
   End With
   ActiveDocument.Sections(4).ProtectedForForms = True

   End Sub

This works. Thanks!

regards,
pweter

> peter was telling us:
> peter nous racontait que :
[quoted text clipped - 20 lines]
> reprotecting it?
> See Protect / Unprotect in the on-line VBA help.
Jean-Guy Marcil - 17 Dec 2004 14:41 GMT
Aquarius was telling us:
Aquarius nous racontait que :

> Jean-Guy,
> BRILLIANT! Your remark is sooo simple; stupid I did not come up with
> it ;-)

LOL
Don't worry, I know how it is... Sometimes we are so deep in our problem we
can't see the answer floating on the surface... Been there!

Glad I could help!

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

 
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.