#1   Report Post  
Posted to microsoft.public.word.docmanagement
Max Max is offline
external usenet poster
 
Posts: 27
Default Content Controls

Is there a way to have the user move easily from one content control to
another?
In Word 2003, used Text Form Fields and could use F11 key, but not the same
in Word 2007.
Have looked in Help and KB - no results.
Used the Browse button to browse Fields, but did not work. Used Tab key, did
not work.
Please help!
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Content Controls

On Mon, 5 Oct 2009 15:44:02 -0700, Max
wrote:

Is there a way to have the user move easily from one content control to
another?
In Word 2003, used Text Form Fields and could use F11 key, but not the same
in Word 2007.
Have looked in Help and KB - no results.
Used the Browse button to browse Fields, but did not work. Used Tab key, did
not work.
Please help!


The Tab key will move between content controls EXCEPT when the cursor
is in a Rich Text content control where it's required to produce a tab
character, or a building block gallery content control.

It might be possible to program a Document_ContentControlOnExit macro
to move the cursor from a specific rich text content control to the
next content control when you mouse or arrow (but not tab) out. For
example, if the controls are given Tag values of RT1 (for rich text)
and PT1 (for plain text), this macro would do.

Private Sub Document_ContentControlOnExit(ByVal CCtrl As _
ContentControl, Cancel As Boolean)
Dim cc As ContentControl
If CCtrl.Tag = "RT1" Then
For Each cc In ActiveDocument.ContentControls
If cc.Tag = "PT1" Then
cc.Range.Select
Selection.Collapse wdCollapseStart
Exit For
End If
Next
End If
End Sub

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Max Max is offline
external usenet poster
 
Posts: 27
Default Content Controls

Jay,

Sorry, but the tab key does not work. Where do I hang that macro? There is
no place I can find to put an "On Exit" macro...


"Jay Freedman" wrote:

On Mon, 5 Oct 2009 15:44:02 -0700, Max
wrote:

Is there a way to have the user move easily from one content control to
another?
In Word 2003, used Text Form Fields and could use F11 key, but not the same
in Word 2007.
Have looked in Help and KB - no results.
Used the Browse button to browse Fields, but did not work. Used Tab key, did
not work.
Please help!


The Tab key will move between content controls EXCEPT when the cursor
is in a Rich Text content control where it's required to produce a tab
character, or a building block gallery content control.

It might be possible to program a Document_ContentControlOnExit macro
to move the cursor from a specific rich text content control to the
next content control when you mouse or arrow (but not tab) out. For
example, if the controls are given Tag values of RT1 (for rich text)
and PT1 (for plain text), this macro would do.

Private Sub Document_ContentControlOnExit(ByVal CCtrl As _
ContentControl, Cancel As Boolean)
Dim cc As ContentControl
If CCtrl.Tag = "RT1" Then
For Each cc In ActiveDocument.ContentControls
If cc.Tag = "PT1" Then
cc.Range.Select
Selection.Collapse wdCollapseStart
Exit For
End If
Next
End If
End Sub

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.

  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Content Controls

Hmm. The tab key works for me, on multiple computers. It's a mystery...

Put the macro into the ThisDocument module of the form document or template.
You'll have to save the file as a macro-enabled document (.docm) or template
(.dotm), otherwise the macro would be discarded during the save. And you'll
need to save it in a trusted location so the macro won't be disabled on
reopening (Office button Word Options Trust Center Trust Center
Settings Trusted Locations).

Content controls don't have any way to specify an "On Entry" or "On Exit"
macro like legacy form fields. Instead they have event handlers -- which is
what Document_ContentControlOnExit is, for the Exit event -- that fire
whenever the cursor enters or exits *any* content control. Then the code in
the handler has to figure out whether the control involved (passed in the
argument CCtrl) is one for which it should do something. My example uses the
control's Tag value to make that decision, but there are other things it
could look at, such as the Title or the ID value.

Max wrote:
Jay,

Sorry, but the tab key does not work. Where do I hang that macro?
There is no place I can find to put an "On Exit" macro...


"Jay Freedman" wrote:

On Mon, 5 Oct 2009 15:44:02 -0700, Max

wrote:

Is there a way to have the user move easily from one content
control to another?
In Word 2003, used Text Form Fields and could use F11 key, but not
the same in Word 2007.
Have looked in Help and KB - no results.
Used the Browse button to browse Fields, but did not work. Used Tab
key, did not work.
Please help!


The Tab key will move between content controls EXCEPT when the cursor
is in a Rich Text content control where it's required to produce a
tab
character, or a building block gallery content control.

It might be possible to program a Document_ContentControlOnExit macro
to move the cursor from a specific rich text content control to the
next content control when you mouse or arrow (but not tab) out. For
example, if the controls are given Tag values of RT1 (for rich text)
and PT1 (for plain text), this macro would do.

Private Sub Document_ContentControlOnExit(ByVal CCtrl As _
ContentControl, Cancel As Boolean)
Dim cc As ContentControl
If CCtrl.Tag = "RT1" Then
For Each cc In ActiveDocument.ContentControls
If cc.Tag = "PT1" Then
cc.Range.Select
Selection.Collapse wdCollapseStart
Exit For
End If
Next
End If
End Sub

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Content Controls Office_user Microsoft Word Help 5 July 1st 08 09:10 AM
Content Controls Elvis Microsoft Word Help 1 March 20th 08 12:56 PM
Content Controls Office_user Microsoft Word Help 1 August 28th 07 02:48 PM
Need Help with Content Controls sncmd_98 Microsoft Word Help 1 June 16th 07 07:30 AM
Content types and content controls Øyvind Skaar Microsoft Word Help 0 May 14th 07 04:17 PM


All times are GMT +1. The time now is 12:39 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"