Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Content Controls | Microsoft Word Help | |||
Content Controls | Microsoft Word Help | |||
Content Controls | Microsoft Word Help | |||
Need Help with Content Controls | Microsoft Word Help | |||
Content types and content controls | Microsoft Word Help |