Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Natalie W.[_2_] Natalie W.[_2_] is offline
external usenet poster
 
Posts: 6
Default How can I set an automated form to show/hide a section?

Hi all, I'm working in Word 2003 making an automated form template (trying,
anyway). Under the first question, the user can select "new" or "existing"
from the drop-down field. When the user selects "existing," I want a section
to appear/show/drop/toggle (I'm not sure what the right verbiage is) that
will give them some options to choose from, i.e. "existing member already has
the following: (check boxes) a, b, c, d, e"...etc. If the user selects "new,"
I dont want this section to appear since it will not be applicable.

I'm brand-spanking new to the world of macros and VBE...please keep in mind
when explaining. Thanks in advance and I really appreciate any help you can
give.
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default How can I set an automated form to show/hide a section?

Natalie W. wrote:
Hi all, I'm working in Word 2003 making an automated form template
(trying, anyway). Under the first question, the user can select "new"
or "existing" from the drop-down field. When the user selects
"existing," I want a section to appear/show/drop/toggle (I'm not sure
what the right verbiage is) that will give them some options to
choose from, i.e. "existing member already has the following: (check
boxes) a, b, c, d, e"...etc. If the user selects "new," I dont want
this section to appear since it will not be applicable.

I'm brand-spanking new to the world of macros and VBE...please keep
in mind when explaining. Thanks in advance and I really appreciate
any help you can give.


Have a look at MVP Greg Maxey's page at
http://gregmaxey.mvps.org/Toggle_Data_Display.htm, and follow the links
there for additional help. If you get part way through it and can't get
something to work, post here and describe the problem.

--
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
Natalie W.[_2_] Natalie W.[_2_] is offline
external usenet poster
 
Posts: 6
Default How can I set an automated form to show/hide a section?

What I want my form to do is if a formcheckbox is selected, then other
formcheckboxes are displayed, providing more options. if the formcheckbox is
not selected (or "x"ed), then the other formcheckboxes do not display.

I did read Greg Maxey's toggle data display, but i'm not sure how to write
the macro named showhide2 to make it do what i want. is there any way i can
do this without macros? maybe just field codes? i've purchased 2 books (Word
Bible and Step by Step Word) and cannot find what i'm looking for. I know i
probably sound like an idiot because, if not obvious, I don't really know
what I'm talking about...I just know what i wish my form would do.


please help me. i'm going on week 3 of trying to figure this thing
out...(hopefully that will get me some sympathy.)

"Jay Freedman" wrote:

Natalie W. wrote:
Hi all, I'm working in Word 2003 making an automated form template
(trying, anyway). Under the first question, the user can select "new"
or "existing" from the drop-down field. When the user selects
"existing," I want a section to appear/show/drop/toggle (I'm not sure
what the right verbiage is) that will give them some options to
choose from, i.e. "existing member already has the following: (check
boxes) a, b, c, d, e"...etc. If the user selects "new," I dont want
this section to appear since it will not be applicable.

I'm brand-spanking new to the world of macros and VBE...please keep
in mind when explaining. Thanks in advance and I really appreciate
any help you can give.


Have a look at MVP Greg Maxey's page at
http://gregmaxey.mvps.org/Toggle_Data_Display.htm, and follow the links
there for additional help. If you get part way through it and can't get
something to work, post here and describe the problem.

--
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 How can I set an automated form to show/hide a section?

Hi Natalie,

First, resign yourself to the fact that there's no simple way to do
this job in Word, and in particular there's no way to do it without
macros.

You can use the macros in Greg's page almost exactly as they are; just
copy and paste the corrected version from this message into a module
in the form's template (follow the link
http://www.gmayor.com/installing_macro.htm to get instructions if
necessary).

Option Explicit

Const pValue_1 = "Show"
Const pValue_2 = "Hide"

Sub CallShowHide()
ShowHide Selection.Bookmarks(1).Name
End Sub


Sub ShowHide(pVarName As String)
Dim pValue As String
On Error Resume Next
pValue = ActiveDocument.Variables(pVarName).Value
On Error GoTo 0
If pValue = "" Or pValue = pValue_2 Then
pValue = pValue_1
Else
pValue = pValue_2
End If
ActiveDocument.Variables(pVarName).Value = pValue
ActiveDocument.Fields.Update
End Sub

One thing Greg neglected to discuss in the article is that there are
bookmarks surrounding the MACROBUTTON fields. Those are the gray
square brackets that you see in his screen shots. The bookmark around
the field in the first row must be named ShowHide1 (the same as the
name in the DOCVARIABLE field in the same row), and the bookmark
around the field in the second row must be named ShowHide2. If you
have more toggles, just keep increasing the number on the end of the
names.

Another thing Greg didn't address explicitly is that his method can be
used in a protected form, and the AutoText entries can contain
checkbox formfields -- but the MACROBUTTON fields that toggle the
visibility of the AutoTexts have to contain characters that only look
like check boxes or buttons, not real checkbox formfields. You can
find appropriate characters in the Wingdings font.

If you want to see a real working template that uses this stuff, let
me know and I'll post one on a web page where you can download it.

--
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.

On Tue, 8 May 2007 09:36:02 -0700, Natalie W.
wrote:

What I want my form to do is if a formcheckbox is selected, then other
formcheckboxes are displayed, providing more options. if the formcheckbox is
not selected (or "x"ed), then the other formcheckboxes do not display.

I did read Greg Maxey's toggle data display, but i'm not sure how to write
the macro named showhide2 to make it do what i want. is there any way i can
do this without macros? maybe just field codes? i've purchased 2 books (Word
Bible and Step by Step Word) and cannot find what i'm looking for. I know i
probably sound like an idiot because, if not obvious, I don't really know
what I'm talking about...I just know what i wish my form would do.


please help me. i'm going on week 3 of trying to figure this thing
out...(hopefully that will get me some sympathy.)

"Jay Freedman" wrote:

Natalie W. wrote:
Hi all, I'm working in Word 2003 making an automated form template
(trying, anyway). Under the first question, the user can select "new"
or "existing" from the drop-down field. When the user selects
"existing," I want a section to appear/show/drop/toggle (I'm not sure
what the right verbiage is) that will give them some options to
choose from, i.e. "existing member already has the following: (check
boxes) a, b, c, d, e"...etc. If the user selects "new," I dont want
this section to appear since it will not be applicable.

I'm brand-spanking new to the world of macros and VBE...please keep
in mind when explaining. Thanks in advance and I really appreciate
any help you can give.


Have a look at MVP Greg Maxey's page at
http://gregmaxey.mvps.org/Toggle_Data_Display.htm, and follow the links
there for additional help. If you get part way through it and can't get
something to work, post here and describe the problem.

--
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.



  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Natalie W.[_2_] Natalie W.[_2_] is offline
external usenet poster
 
Posts: 6
Default How can I set an automated form to show/hide a section?

Hi Jay,

Thank you so much for responding to this and for your help and patience with
me. I would like to download a real working sample template of this if you
could share.

Again, you've been tremendously helpful and thanx for sharing your knowledge.

"Jay Freedman" wrote:

Hi Natalie,

First, resign yourself to the fact that there's no simple way to do
this job in Word, and in particular there's no way to do it without
macros.

You can use the macros in Greg's page almost exactly as they are; just
copy and paste the corrected version from this message into a module
in the form's template (follow the link
http://www.gmayor.com/installing_macro.htm to get instructions if
necessary).

Option Explicit

Const pValue_1 = "Show"
Const pValue_2 = "Hide"

Sub CallShowHide()
ShowHide Selection.Bookmarks(1).Name
End Sub


Sub ShowHide(pVarName As String)
Dim pValue As String
On Error Resume Next
pValue = ActiveDocument.Variables(pVarName).Value
On Error GoTo 0
If pValue = "" Or pValue = pValue_2 Then
pValue = pValue_1
Else
pValue = pValue_2
End If
ActiveDocument.Variables(pVarName).Value = pValue
ActiveDocument.Fields.Update
End Sub

One thing Greg neglected to discuss in the article is that there are
bookmarks surrounding the MACROBUTTON fields. Those are the gray
square brackets that you see in his screen shots. The bookmark around
the field in the first row must be named ShowHide1 (the same as the
name in the DOCVARIABLE field in the same row), and the bookmark
around the field in the second row must be named ShowHide2. If you
have more toggles, just keep increasing the number on the end of the
names.

Another thing Greg didn't address explicitly is that his method can be
used in a protected form, and the AutoText entries can contain
checkbox formfields -- but the MACROBUTTON fields that toggle the
visibility of the AutoTexts have to contain characters that only look
like check boxes or buttons, not real checkbox formfields. You can
find appropriate characters in the Wingdings font.

If you want to see a real working template that uses this stuff, let
me know and I'll post one on a web page where you can download it.

--
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.

On Tue, 8 May 2007 09:36:02 -0700, Natalie W.
wrote:

What I want my form to do is if a formcheckbox is selected, then other
formcheckboxes are displayed, providing more options. if the formcheckbox is
not selected (or "x"ed), then the other formcheckboxes do not display.

I did read Greg Maxey's toggle data display, but i'm not sure how to write
the macro named showhide2 to make it do what i want. is there any way i can
do this without macros? maybe just field codes? i've purchased 2 books (Word
Bible and Step by Step Word) and cannot find what i'm looking for. I know i
probably sound like an idiot because, if not obvious, I don't really know
what I'm talking about...I just know what i wish my form would do.


please help me. i'm going on week 3 of trying to figure this thing
out...(hopefully that will get me some sympathy.)

"Jay Freedman" wrote:

Natalie W. wrote:
Hi all, I'm working in Word 2003 making an automated form template
(trying, anyway). Under the first question, the user can select "new"
or "existing" from the drop-down field. When the user selects
"existing," I want a section to appear/show/drop/toggle (I'm not sure
what the right verbiage is) that will give them some options to
choose from, i.e. "existing member already has the following: (check
boxes) a, b, c, d, e"...etc. If the user selects "new," I dont want
this section to appear since it will not be applicable.

I'm brand-spanking new to the world of macros and VBE...please keep
in mind when explaining. Thanks in advance and I really appreciate
any help you can give.

Have a look at MVP Greg Maxey's page at
http://gregmaxey.mvps.org/Toggle_Data_Display.htm, and follow the links
there for additional help. If you get part way through it and can't get
something to work, post here and describe the problem.

--
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.






  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default How can I set an automated form to show/hide a section?

Hi Natalie,

You can download http://jay-freedman.info/toggle.dot (save it to disk and
put it in your Templates folder, then use File New to make a new document
based on it).

The template has a lot of "moving parts" that all need to work together
based on the names you give to things:

- Each Macrobutton field is surrounded by a bookmark. The name of the
bookmark is 'ShowHide' followed by a unique number.

- For each macro button, there is an AutoText entry stored in the template,
containing the stuff that gets shown or hidden. The name of the AutoText
must include the same number as appears in the name of the corresponding
bookmark.

- For each macro button, there is an IF field containing nested DocVariable
and AutoText fields. The DocVariable field must contain the name of the
corresponding bookmark, including the number. The AutoText field must
contain the name of the AutoText entry.

- The IF field is surrounded by a bookmark whose name is 'Toggle' followed
by the same number as appears in the name of the corresponding bookmark.

As long as you follow those rules, you can add more sets of Macrobutton /
fields / bookmarks / AutoText entry without having to change anything in the
macros.

This template has forms protection turned on, only so the checkboxes within
the AutoText entries will operate. If your AutoText entries don't contain
form fields, and there aren't any form fields elsewhere in the document,
then you don't have to turn on forms protection.

--
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.

Natalie W. wrote:
Hi Jay,

Thank you so much for responding to this and for your help and
patience with me. I would like to download a real working sample
template of this if you could share.

Again, you've been tremendously helpful and thanx for sharing your
knowledge.

"Jay Freedman" wrote:

Hi Natalie,

First, resign yourself to the fact that there's no simple way to do
this job in Word, and in particular there's no way to do it without
macros.

You can use the macros in Greg's page almost exactly as they are;
just copy and paste the corrected version from this message into a
module in the form's template (follow the link
http://www.gmayor.com/installing_macro.htm to get instructions if
necessary).

Option Explicit

Const pValue_1 = "Show"
Const pValue_2 = "Hide"

Sub CallShowHide()
ShowHide Selection.Bookmarks(1).Name
End Sub


Sub ShowHide(pVarName As String)
Dim pValue As String
On Error Resume Next
pValue = ActiveDocument.Variables(pVarName).Value
On Error GoTo 0
If pValue = "" Or pValue = pValue_2 Then
pValue = pValue_1
Else
pValue = pValue_2
End If
ActiveDocument.Variables(pVarName).Value = pValue
ActiveDocument.Fields.Update
End Sub

One thing Greg neglected to discuss in the article is that there are
bookmarks surrounding the MACROBUTTON fields. Those are the gray
square brackets that you see in his screen shots. The bookmark around
the field in the first row must be named ShowHide1 (the same as the
name in the DOCVARIABLE field in the same row), and the bookmark
around the field in the second row must be named ShowHide2. If you
have more toggles, just keep increasing the number on the end of the
names.

Another thing Greg didn't address explicitly is that his method can
be used in a protected form, and the AutoText entries can contain
checkbox formfields -- but the MACROBUTTON fields that toggle the
visibility of the AutoTexts have to contain characters that only look
like check boxes or buttons, not real checkbox formfields. You can
find appropriate characters in the Wingdings font.

If you want to see a real working template that uses this stuff, let
me know and I'll post one on a web page where you can download it.

--
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.

On Tue, 8 May 2007 09:36:02 -0700, Natalie W.
wrote:

What I want my form to do is if a formcheckbox is selected, then
other formcheckboxes are displayed, providing more options. if the
formcheckbox is not selected (or "x"ed), then the other
formcheckboxes do not display.

I did read Greg Maxey's toggle data display, but i'm not sure how
to write the macro named showhide2 to make it do what i want. is
there any way i can do this without macros? maybe just field codes?
i've purchased 2 books (Word Bible and Step by Step Word) and
cannot find what i'm looking for. I know i probably sound like an
idiot because, if not obvious, I don't really know what I'm talking
about...I just know what i wish my form would do.


please help me. i'm going on week 3 of trying to figure this thing
out...(hopefully that will get me some sympathy.)

"Jay Freedman" wrote:

Natalie W. wrote:
Hi all, I'm working in Word 2003 making an automated form template
(trying, anyway). Under the first question, the user can select
"new" or "existing" from the drop-down field. When the user
selects "existing," I want a section to appear/show/drop/toggle
(I'm not sure what the right verbiage is) that will give them
some options to choose from, i.e. "existing member already has
the following: (check boxes) a, b, c, d, e"...etc. If the user
selects "new," I dont want this section to appear since it will
not be applicable.

I'm brand-spanking new to the world of macros and VBE...please
keep in mind when explaining. Thanks in advance and I really
appreciate any help you can give.

Have a look at MVP Greg Maxey's page at
http://gregmaxey.mvps.org/Toggle_Data_Display.htm, and follow the
links there for additional help. If you get part way through it
and can't get something to work, post here and describe the
problem.

--
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.



  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Natalie W.[_2_] Natalie W.[_2_] is offline
external usenet poster
 
Posts: 6
Default How can I set an automated form to show/hide a section?

Hi Jay,

I don't know how to put into words my gratitude for all your help. Thank you
so very much for this. I cannot thank you enough for taking the time to do
this. Truly you are a very kind human being. I cannot praise and thank you
enough.

Sincerely,

Natalie W.

"Jay Freedman" wrote:

Hi Natalie,

You can download http://jay-freedman.info/toggle.dot (save it to disk and
put it in your Templates folder, then use File New to make a new document
based on it).

The template has a lot of "moving parts" that all need to work together
based on the names you give to things:

- Each Macrobutton field is surrounded by a bookmark. The name of the
bookmark is 'ShowHide' followed by a unique number.

- For each macro button, there is an AutoText entry stored in the template,
containing the stuff that gets shown or hidden. The name of the AutoText
must include the same number as appears in the name of the corresponding
bookmark.

- For each macro button, there is an IF field containing nested DocVariable
and AutoText fields. The DocVariable field must contain the name of the
corresponding bookmark, including the number. The AutoText field must
contain the name of the AutoText entry.

- The IF field is surrounded by a bookmark whose name is 'Toggle' followed
by the same number as appears in the name of the corresponding bookmark.

As long as you follow those rules, you can add more sets of Macrobutton /
fields / bookmarks / AutoText entry without having to change anything in the
macros.

This template has forms protection turned on, only so the checkboxes within
the AutoText entries will operate. If your AutoText entries don't contain
form fields, and there aren't any form fields elsewhere in the document,
then you don't have to turn on forms protection.

--
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.

Natalie W. wrote:
Hi Jay,

Thank you so much for responding to this and for your help and
patience with me. I would like to download a real working sample
template of this if you could share.

Again, you've been tremendously helpful and thanx for sharing your
knowledge.

"Jay Freedman" wrote:

Hi Natalie,

First, resign yourself to the fact that there's no simple way to do
this job in Word, and in particular there's no way to do it without
macros.

You can use the macros in Greg's page almost exactly as they are;
just copy and paste the corrected version from this message into a
module in the form's template (follow the link
http://www.gmayor.com/installing_macro.htm to get instructions if
necessary).

Option Explicit

Const pValue_1 = "Show"
Const pValue_2 = "Hide"

Sub CallShowHide()
ShowHide Selection.Bookmarks(1).Name
End Sub


Sub ShowHide(pVarName As String)
Dim pValue As String
On Error Resume Next
pValue = ActiveDocument.Variables(pVarName).Value
On Error GoTo 0
If pValue = "" Or pValue = pValue_2 Then
pValue = pValue_1
Else
pValue = pValue_2
End If
ActiveDocument.Variables(pVarName).Value = pValue
ActiveDocument.Fields.Update
End Sub

One thing Greg neglected to discuss in the article is that there are
bookmarks surrounding the MACROBUTTON fields. Those are the gray
square brackets that you see in his screen shots. The bookmark around
the field in the first row must be named ShowHide1 (the same as the
name in the DOCVARIABLE field in the same row), and the bookmark
around the field in the second row must be named ShowHide2. If you
have more toggles, just keep increasing the number on the end of the
names.

Another thing Greg didn't address explicitly is that his method can
be used in a protected form, and the AutoText entries can contain
checkbox formfields -- but the MACROBUTTON fields that toggle the
visibility of the AutoTexts have to contain characters that only look
like check boxes or buttons, not real checkbox formfields. You can
find appropriate characters in the Wingdings font.

If you want to see a real working template that uses this stuff, let
me know and I'll post one on a web page where you can download it.

--
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.

On Tue, 8 May 2007 09:36:02 -0700, Natalie W.
wrote:

What I want my form to do is if a formcheckbox is selected, then
other formcheckboxes are displayed, providing more options. if the
formcheckbox is not selected (or "x"ed), then the other
formcheckboxes do not display.

I did read Greg Maxey's toggle data display, but i'm not sure how
to write the macro named showhide2 to make it do what i want. is
there any way i can do this without macros? maybe just field codes?
i've purchased 2 books (Word Bible and Step by Step Word) and
cannot find what i'm looking for. I know i probably sound like an
idiot because, if not obvious, I don't really know what I'm talking
about...I just know what i wish my form would do.


please help me. i'm going on week 3 of trying to figure this thing
out...(hopefully that will get me some sympathy.)

"Jay Freedman" wrote:

Natalie W. wrote:
Hi all, I'm working in Word 2003 making an automated form template
(trying, anyway). Under the first question, the user can select
"new" or "existing" from the drop-down field. When the user
selects "existing," I want a section to appear/show/drop/toggle
(I'm not sure what the right verbiage is) that will give them
some options to choose from, i.e. "existing member already has
the following: (check boxes) a, b, c, d, e"...etc. If the user
selects "new," I dont want this section to appear since it will
not be applicable.

I'm brand-spanking new to the world of macros and VBE...please
keep in mind when explaining. Thanks in advance and I really
appreciate any help you can give.

Have a look at MVP Greg Maxey's page at
http://gregmaxey.mvps.org/Toggle_Data_Display.htm, and follow the
links there for additional help. If you get part way through it
and can't get something to work, post here and describe the
problem.

--
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.




  #8   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default How can I set an automated form to show/hide a section?

You're certainly welcome -- but you might want to wait until you've
tried to apply the scheme to your own template, and ask more questions
if some part of it isn't working right.

--
Jay

On Wed, 9 May 2007 15:04:00 -0700, Natalie W.
wrote:

Hi Jay,

I don't know how to put into words my gratitude for all your help. Thank you
so very much for this. I cannot thank you enough for taking the time to do
this. Truly you are a very kind human being. I cannot praise and thank you
enough.

Sincerely,

Natalie W.

"Jay Freedman" wrote:

Hi Natalie,

You can download http://jay-freedman.info/toggle.dot (save it to disk and
put it in your Templates folder, then use File New to make a new document
based on it).

The template has a lot of "moving parts" that all need to work together
based on the names you give to things:

- Each Macrobutton field is surrounded by a bookmark. The name of the
bookmark is 'ShowHide' followed by a unique number.

- For each macro button, there is an AutoText entry stored in the template,
containing the stuff that gets shown or hidden. The name of the AutoText
must include the same number as appears in the name of the corresponding
bookmark.

- For each macro button, there is an IF field containing nested DocVariable
and AutoText fields. The DocVariable field must contain the name of the
corresponding bookmark, including the number. The AutoText field must
contain the name of the AutoText entry.

- The IF field is surrounded by a bookmark whose name is 'Toggle' followed
by the same number as appears in the name of the corresponding bookmark.

As long as you follow those rules, you can add more sets of Macrobutton /
fields / bookmarks / AutoText entry without having to change anything in the
macros.

This template has forms protection turned on, only so the checkboxes within
the AutoText entries will operate. If your AutoText entries don't contain
form fields, and there aren't any form fields elsewhere in the document,
then you don't have to turn on forms protection.

--
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.

Natalie W. wrote:
Hi Jay,

Thank you so much for responding to this and for your help and
patience with me. I would like to download a real working sample
template of this if you could share.

Again, you've been tremendously helpful and thanx for sharing your
knowledge.

"Jay Freedman" wrote:

Hi Natalie,

First, resign yourself to the fact that there's no simple way to do
this job in Word, and in particular there's no way to do it without
macros.

You can use the macros in Greg's page almost exactly as they are;
just copy and paste the corrected version from this message into a
module in the form's template (follow the link
http://www.gmayor.com/installing_macro.htm to get instructions if
necessary).

Option Explicit

Const pValue_1 = "Show"
Const pValue_2 = "Hide"

Sub CallShowHide()
ShowHide Selection.Bookmarks(1).Name
End Sub


Sub ShowHide(pVarName As String)
Dim pValue As String
On Error Resume Next
pValue = ActiveDocument.Variables(pVarName).Value
On Error GoTo 0
If pValue = "" Or pValue = pValue_2 Then
pValue = pValue_1
Else
pValue = pValue_2
End If
ActiveDocument.Variables(pVarName).Value = pValue
ActiveDocument.Fields.Update
End Sub

One thing Greg neglected to discuss in the article is that there are
bookmarks surrounding the MACROBUTTON fields. Those are the gray
square brackets that you see in his screen shots. The bookmark around
the field in the first row must be named ShowHide1 (the same as the
name in the DOCVARIABLE field in the same row), and the bookmark
around the field in the second row must be named ShowHide2. If you
have more toggles, just keep increasing the number on the end of the
names.

Another thing Greg didn't address explicitly is that his method can
be used in a protected form, and the AutoText entries can contain
checkbox formfields -- but the MACROBUTTON fields that toggle the
visibility of the AutoTexts have to contain characters that only look
like check boxes or buttons, not real checkbox formfields. You can
find appropriate characters in the Wingdings font.

If you want to see a real working template that uses this stuff, let
me know and I'll post one on a web page where you can download it.

--
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.

On Tue, 8 May 2007 09:36:02 -0700, Natalie W.
wrote:

What I want my form to do is if a formcheckbox is selected, then
other formcheckboxes are displayed, providing more options. if the
formcheckbox is not selected (or "x"ed), then the other
formcheckboxes do not display.

I did read Greg Maxey's toggle data display, but i'm not sure how
to write the macro named showhide2 to make it do what i want. is
there any way i can do this without macros? maybe just field codes?
i've purchased 2 books (Word Bible and Step by Step Word) and
cannot find what i'm looking for. I know i probably sound like an
idiot because, if not obvious, I don't really know what I'm talking
about...I just know what i wish my form would do.


please help me. i'm going on week 3 of trying to figure this thing
out...(hopefully that will get me some sympathy.)

"Jay Freedman" wrote:

Natalie W. wrote:
Hi all, I'm working in Word 2003 making an automated form template
(trying, anyway). Under the first question, the user can select
"new" or "existing" from the drop-down field. When the user
selects "existing," I want a section to appear/show/drop/toggle
(I'm not sure what the right verbiage is) that will give them
some options to choose from, i.e. "existing member already has
the following: (check boxes) a, b, c, d, e"...etc. If the user
selects "new," I dont want this section to appear since it will
not be applicable.

I'm brand-spanking new to the world of macros and VBE...please
keep in mind when explaining. Thanks in advance and I really
appreciate any help you can give.

Have a look at MVP Greg Maxey's page at
http://gregmaxey.mvps.org/Toggle_Data_Display.htm, and follow the
links there for additional help. If you get part way through it
and can't get something to work, post here and describe the
problem.

--
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.





--
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.
  #9   Report Post  
Posted to microsoft.public.word.docmanagement
Natalie W.[_2_] Natalie W.[_2_] is offline
external usenet poster
 
Posts: 6
Default How can I set an automated form to show/hide a section?

Ok, you predicted right--I've got one more question...

I know I cannot use the form checkbox in the macrobutton, but instead, can I
somehow set it up so that different characters/symbols are displayed when the
autotext is toggled on or off? For example, when the autotext is toggled to
hide, there's a box symbol, but when the autotext is toggled to show, the
symbol changes to a box with an x in it.

"Jay Freedman" wrote:

You're certainly welcome -- but you might want to wait until you've
tried to apply the scheme to your own template, and ask more questions
if some part of it isn't working right.

--
Jay

On Wed, 9 May 2007 15:04:00 -0700, Natalie W.
wrote:

Hi Jay,

I don't know how to put into words my gratitude for all your help. Thank you
so very much for this. I cannot thank you enough for taking the time to do
this. Truly you are a very kind human being. I cannot praise and thank you
enough.

Sincerely,

Natalie W.

"Jay Freedman" wrote:

Hi Natalie,

You can download http://jay-freedman.info/toggle.dot (save it to disk and
put it in your Templates folder, then use File New to make a new document
based on it).

The template has a lot of "moving parts" that all need to work together
based on the names you give to things:

- Each Macrobutton field is surrounded by a bookmark. The name of the
bookmark is 'ShowHide' followed by a unique number.

- For each macro button, there is an AutoText entry stored in the template,
containing the stuff that gets shown or hidden. The name of the AutoText
must include the same number as appears in the name of the corresponding
bookmark.

- For each macro button, there is an IF field containing nested DocVariable
and AutoText fields. The DocVariable field must contain the name of the
corresponding bookmark, including the number. The AutoText field must
contain the name of the AutoText entry.

- The IF field is surrounded by a bookmark whose name is 'Toggle' followed
by the same number as appears in the name of the corresponding bookmark.

As long as you follow those rules, you can add more sets of Macrobutton /
fields / bookmarks / AutoText entry without having to change anything in the
macros.

This template has forms protection turned on, only so the checkboxes within
the AutoText entries will operate. If your AutoText entries don't contain
form fields, and there aren't any form fields elsewhere in the document,
then you don't have to turn on forms protection.

--
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.

Natalie W. wrote:
Hi Jay,

Thank you so much for responding to this and for your help and
patience with me. I would like to download a real working sample
template of this if you could share.

Again, you've been tremendously helpful and thanx for sharing your
knowledge.

"Jay Freedman" wrote:

Hi Natalie,

First, resign yourself to the fact that there's no simple way to do
this job in Word, and in particular there's no way to do it without
macros.

You can use the macros in Greg's page almost exactly as they are;
just copy and paste the corrected version from this message into a
module in the form's template (follow the link
http://www.gmayor.com/installing_macro.htm to get instructions if
necessary).

Option Explicit

Const pValue_1 = "Show"
Const pValue_2 = "Hide"

Sub CallShowHide()
ShowHide Selection.Bookmarks(1).Name
End Sub


Sub ShowHide(pVarName As String)
Dim pValue As String
On Error Resume Next
pValue = ActiveDocument.Variables(pVarName).Value
On Error GoTo 0
If pValue = "" Or pValue = pValue_2 Then
pValue = pValue_1
Else
pValue = pValue_2
End If
ActiveDocument.Variables(pVarName).Value = pValue
ActiveDocument.Fields.Update
End Sub

One thing Greg neglected to discuss in the article is that there are
bookmarks surrounding the MACROBUTTON fields. Those are the gray
square brackets that you see in his screen shots. The bookmark around
the field in the first row must be named ShowHide1 (the same as the
name in the DOCVARIABLE field in the same row), and the bookmark
around the field in the second row must be named ShowHide2. If you
have more toggles, just keep increasing the number on the end of the
names.

Another thing Greg didn't address explicitly is that his method can
be used in a protected form, and the AutoText entries can contain
checkbox formfields -- but the MACROBUTTON fields that toggle the
visibility of the AutoTexts have to contain characters that only look
like check boxes or buttons, not real checkbox formfields. You can
find appropriate characters in the Wingdings font.

If you want to see a real working template that uses this stuff, let
me know and I'll post one on a web page where you can download it.

--
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.

On Tue, 8 May 2007 09:36:02 -0700, Natalie W.
wrote:

What I want my form to do is if a formcheckbox is selected, then
other formcheckboxes are displayed, providing more options. if the
formcheckbox is not selected (or "x"ed), then the other
formcheckboxes do not display.

I did read Greg Maxey's toggle data display, but i'm not sure how
to write the macro named showhide2 to make it do what i want. is
there any way i can do this without macros? maybe just field codes?
i've purchased 2 books (Word Bible and Step by Step Word) and
cannot find what i'm looking for. I know i probably sound like an
idiot because, if not obvious, I don't really know what I'm talking
about...I just know what i wish my form would do.


please help me. i'm going on week 3 of trying to figure this thing
out...(hopefully that will get me some sympathy.)

"Jay Freedman" wrote:

Natalie W. wrote:
Hi all, I'm working in Word 2003 making an automated form template
(trying, anyway). Under the first question, the user can select
"new" or "existing" from the drop-down field. When the user
selects "existing," I want a section to appear/show/drop/toggle
(I'm not sure what the right verbiage is) that will give them
some options to choose from, i.e. "existing member already has
the following: (check boxes) a, b, c, d, e"...etc. If the user
selects "new," I dont want this section to appear since it will
not be applicable.

I'm brand-spanking new to the world of macros and VBE...please
keep in mind when explaining. Thanks in advance and I really
appreciate any help you can give.

Have a look at MVP Greg Maxey's page at
http://gregmaxey.mvps.org/Toggle_Data_Display.htm, and follow the
links there for additional help. If you get part way through it
and can't get something to work, post here and describe the
problem.

--
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.




--
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.

  #10   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default How can I set an automated form to show/hide a section?

I was afraid you were going to ask that. :-) The answer is yes, at the cost
of additional complexity. I've modified the template and reposted it in the
same place.

The additional parts are these:

- Add two more AutoText entries, one for the unchecked box (the £ character
formatted in Wingdings2 font) and one for the checked box (the S character,
also in Wingdings2). These are named boxblank and boxx.

- Replace the single character in the code of the Macrobutton fields with an
IF field, similar to the one that makes the text in the left column appear
and disappear. In this case, the boxx value appears when the docvariable is
set to "Show", and the boxblank value appears when it's set to "Hide".

- Add a line to the macro to update this new field.

--
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.

Natalie W. wrote:
Ok, you predicted right--I've got one more question...

I know I cannot use the form checkbox in the macrobutton, but
instead, can I somehow set it up so that different characters/symbols
are displayed when the autotext is toggled on or off? For example,
when the autotext is toggled to hide, there's a box symbol, but when
the autotext is toggled to show, the symbol changes to a box with an
x in it.

"Jay Freedman" wrote:

You're certainly welcome -- but you might want to wait until you've
tried to apply the scheme to your own template, and ask more
questions
if some part of it isn't working right.

--
Jay

On Wed, 9 May 2007 15:04:00 -0700, Natalie W.
wrote:

Hi Jay,

I don't know how to put into words my gratitude for all your help.
Thank you so very much for this. I cannot thank you enough for
taking the time to do this. Truly you are a very kind human being.
I cannot praise and thank you enough.

Sincerely,

Natalie W.

"Jay Freedman" wrote:

Hi Natalie,

You can download http://jay-freedman.info/toggle.dot (save it to
disk and put it in your Templates folder, then use File New to
make a new document based on it).

The template has a lot of "moving parts" that all need to work
together based on the names you give to things:

- Each Macrobutton field is surrounded by a bookmark. The name of
the bookmark is 'ShowHide' followed by a unique number.

- For each macro button, there is an AutoText entry stored in the
template, containing the stuff that gets shown or hidden. The name
of the AutoText must include the same number as appears in the
name of the corresponding bookmark.

- For each macro button, there is an IF field containing nested
DocVariable and AutoText fields. The DocVariable field must
contain the name of the corresponding bookmark, including the
number. The AutoText field must contain the name of the AutoText
entry.

- The IF field is surrounded by a bookmark whose name is 'Toggle'
followed by the same number as appears in the name of the
corresponding bookmark.

As long as you follow those rules, you can add more sets of
Macrobutton / fields / bookmarks / AutoText entry without having
to change anything in the macros.

This template has forms protection turned on, only so the
checkboxes within the AutoText entries will operate. If your
AutoText entries don't contain form fields, and there aren't any
form fields elsewhere in the document, then you don't have to turn
on forms protection.

--
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.

Natalie W. wrote:
Hi Jay,

Thank you so much for responding to this and for your help and
patience with me. I would like to download a real working sample
template of this if you could share.

Again, you've been tremendously helpful and thanx for sharing your
knowledge.

"Jay Freedman" wrote:

Hi Natalie,

First, resign yourself to the fact that there's no simple way to
do this job in Word, and in particular there's no way to do it
without macros.

You can use the macros in Greg's page almost exactly as they are;
just copy and paste the corrected version from this message into
a module in the form's template (follow the link
http://www.gmayor.com/installing_macro.htm to get instructions if
necessary).

Option Explicit

Const pValue_1 = "Show"
Const pValue_2 = "Hide"

Sub CallShowHide()
ShowHide Selection.Bookmarks(1).Name
End Sub


Sub ShowHide(pVarName As String)
Dim pValue As String
On Error Resume Next
pValue = ActiveDocument.Variables(pVarName).Value
On Error GoTo 0
If pValue = "" Or pValue = pValue_2 Then
pValue = pValue_1
Else
pValue = pValue_2
End If
ActiveDocument.Variables(pVarName).Value = pValue
ActiveDocument.Fields.Update
End Sub

One thing Greg neglected to discuss in the article is that there
are bookmarks surrounding the MACROBUTTON fields. Those are the
gray square brackets that you see in his screen shots. The
bookmark around the field in the first row must be named
ShowHide1 (the same as the name in the DOCVARIABLE field in the
same row), and the bookmark around the field in the second row
must be named ShowHide2. If you have more toggles, just keep
increasing the number on the end of the names.

Another thing Greg didn't address explicitly is that his method
can be used in a protected form, and the AutoText entries can
contain checkbox formfields -- but the MACROBUTTON fields that
toggle the visibility of the AutoTexts have to contain
characters that only look like check boxes or buttons, not real
checkbox formfields. You can find appropriate characters in the
Wingdings font.

If you want to see a real working template that uses this stuff,
let me know and I'll post one on a web page where you can
download it.

--
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.

On Tue, 8 May 2007 09:36:02 -0700, Natalie W.
wrote:

What I want my form to do is if a formcheckbox is selected, then
other formcheckboxes are displayed, providing more options. if
the formcheckbox is not selected (or "x"ed), then the other
formcheckboxes do not display.

I did read Greg Maxey's toggle data display, but i'm not sure
how to write the macro named showhide2 to make it do what i
want. is there any way i can do this without macros? maybe just
field codes? i've purchased 2 books (Word Bible and Step by
Step Word) and cannot find what i'm looking for. I know i
probably sound like an idiot because, if not obvious, I don't
really know what I'm talking about...I just know what i wish my
form would do.


please help me. i'm going on week 3 of trying to figure this
thing out...(hopefully that will get me some sympathy.)

"Jay Freedman" wrote:

Natalie W. wrote:
Hi all, I'm working in Word 2003 making an automated form
template (trying, anyway). Under the first question, the user
can select "new" or "existing" from the drop-down field. When
the user selects "existing," I want a section to
appear/show/drop/toggle (I'm not sure what the right verbiage
is) that will give them some options to choose from, i.e.
"existing member already has the following: (check boxes) a,
b, c, d, e"...etc. If the user selects "new," I dont want
this section to appear since it will not be applicable.

I'm brand-spanking new to the world of macros and VBE...please
keep in mind when explaining. Thanks in advance and I really
appreciate any help you can give.

Have a look at MVP Greg Maxey's page at
http://gregmaxey.mvps.org/Toggle_Data_Display.htm, and follow
the links there for additional help. If you get part way
through it and can't get something to work, post here and
describe the problem.

--
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.




--
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.





  #11   Report Post  
Posted to microsoft.public.word.docmanagement
Natalie W.[_2_] Natalie W.[_2_] is offline
external usenet poster
 
Posts: 6
Default How can I set an automated form to show/hide a section?

Hi Jay,

I just wanted to thank you again for everything. I cannot even begin to put
into words how grateful I am for your help. Without your direction (and your
template), I would have never figured this out. A million thanx, man.

Natalie W.

"Jay Freedman" wrote:

I was afraid you were going to ask that. :-) The answer is yes, at the cost
of additional complexity. I've modified the template and reposted it in the
same place.

The additional parts are these:

- Add two more AutoText entries, one for the unchecked box (the £ character
formatted in Wingdings2 font) and one for the checked box (the S character,
also in Wingdings2). These are named boxblank and boxx.

- Replace the single character in the code of the Macrobutton fields with an
IF field, similar to the one that makes the text in the left column appear
and disappear. In this case, the boxx value appears when the docvariable is
set to "Show", and the boxblank value appears when it's set to "Hide".

- Add a line to the macro to update this new field.

--
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.

Natalie W. wrote:
Ok, you predicted right--I've got one more question...

I know I cannot use the form checkbox in the macrobutton, but
instead, can I somehow set it up so that different characters/symbols
are displayed when the autotext is toggled on or off? For example,
when the autotext is toggled to hide, there's a box symbol, but when
the autotext is toggled to show, the symbol changes to a box with an
x in it.

"Jay Freedman" wrote:

You're certainly welcome -- but you might want to wait until you've
tried to apply the scheme to your own template, and ask more
questions
if some part of it isn't working right.

--
Jay

On Wed, 9 May 2007 15:04:00 -0700, Natalie W.
wrote:

Hi Jay,

I don't know how to put into words my gratitude for all your help.
Thank you so very much for this. I cannot thank you enough for
taking the time to do this. Truly you are a very kind human being.
I cannot praise and thank you enough.

Sincerely,

Natalie W.

"Jay Freedman" wrote:

Hi Natalie,

You can download http://jay-freedman.info/toggle.dot (save it to
disk and put it in your Templates folder, then use File New to
make a new document based on it).

The template has a lot of "moving parts" that all need to work
together based on the names you give to things:

- Each Macrobutton field is surrounded by a bookmark. The name of
the bookmark is 'ShowHide' followed by a unique number.

- For each macro button, there is an AutoText entry stored in the
template, containing the stuff that gets shown or hidden. The name
of the AutoText must include the same number as appears in the
name of the corresponding bookmark.

- For each macro button, there is an IF field containing nested
DocVariable and AutoText fields. The DocVariable field must
contain the name of the corresponding bookmark, including the
number. The AutoText field must contain the name of the AutoText
entry.

- The IF field is surrounded by a bookmark whose name is 'Toggle'
followed by the same number as appears in the name of the
corresponding bookmark.

As long as you follow those rules, you can add more sets of
Macrobutton / fields / bookmarks / AutoText entry without having
to change anything in the macros.

This template has forms protection turned on, only so the
checkboxes within the AutoText entries will operate. If your
AutoText entries don't contain form fields, and there aren't any
form fields elsewhere in the document, then you don't have to turn
on forms protection.

--
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.

Natalie W. wrote:
Hi Jay,

Thank you so much for responding to this and for your help and
patience with me. I would like to download a real working sample
template of this if you could share.

Again, you've been tremendously helpful and thanx for sharing your
knowledge.

"Jay Freedman" wrote:

Hi Natalie,

First, resign yourself to the fact that there's no simple way to
do this job in Word, and in particular there's no way to do it
without macros.

You can use the macros in Greg's page almost exactly as they are;
just copy and paste the corrected version from this message into
a module in the form's template (follow the link
http://www.gmayor.com/installing_macro.htm to get instructions if
necessary).

Option Explicit

Const pValue_1 = "Show"
Const pValue_2 = "Hide"

Sub CallShowHide()
ShowHide Selection.Bookmarks(1).Name
End Sub


Sub ShowHide(pVarName As String)
Dim pValue As String
On Error Resume Next
pValue = ActiveDocument.Variables(pVarName).Value
On Error GoTo 0
If pValue = "" Or pValue = pValue_2 Then
pValue = pValue_1
Else
pValue = pValue_2
End If
ActiveDocument.Variables(pVarName).Value = pValue
ActiveDocument.Fields.Update
End Sub

One thing Greg neglected to discuss in the article is that there
are bookmarks surrounding the MACROBUTTON fields. Those are the
gray square brackets that you see in his screen shots. The
bookmark around the field in the first row must be named
ShowHide1 (the same as the name in the DOCVARIABLE field in the
same row), and the bookmark around the field in the second row
must be named ShowHide2. If you have more toggles, just keep
increasing the number on the end of the names.

Another thing Greg didn't address explicitly is that his method
can be used in a protected form, and the AutoText entries can
contain checkbox formfields -- but the MACROBUTTON fields that
toggle the visibility of the AutoTexts have to contain
characters that only look like check boxes or buttons, not real
checkbox formfields. You can find appropriate characters in the
Wingdings font.

If you want to see a real working template that uses this stuff,
let me know and I'll post one on a web page where you can
download it.

--
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.

On Tue, 8 May 2007 09:36:02 -0700, Natalie W.
wrote:

What I want my form to do is if a formcheckbox is selected, then
other formcheckboxes are displayed, providing more options. if
the formcheckbox is not selected (or "x"ed), then the other
formcheckboxes do not display.

I did read Greg Maxey's toggle data display, but i'm not sure
how to write the macro named showhide2 to make it do what i
want. is there any way i can do this without macros? maybe just
field codes? i've purchased 2 books (Word Bible and Step by
Step Word) and cannot find what i'm looking for. I know i
probably sound like an idiot because, if not obvious, I don't
really know what I'm talking about...I just know what i wish my
form would do.


please help me. i'm going on week 3 of trying to figure this
thing out...(hopefully that will get me some sympathy.)

"Jay Freedman" wrote:

Natalie W. wrote:
Hi all, I'm working in Word 2003 making an automated form
template (trying, anyway). Under the first question, the user
can select "new" or "existing" from the drop-down field. When
the user selects "existing," I want a section to
appear/show/drop/toggle (I'm not sure what the right verbiage
is) that will give them some options to choose from, i.e.
"existing member already has the following: (check boxes) a,
b, c, d, e"...etc. If the user selects "new," I dont want
this section to appear since it will not be applicable.

I'm brand-spanking new to the world of macros and VBE...please
keep in mind when explaining. Thanks in advance and I really
appreciate any help you can give.

Have a look at MVP Greg Maxey's page at
http://gregmaxey.mvps.org/Toggle_Data_Display.htm, and follow
the links there for additional help. If you get part way
through it and can't get something to work, post here and
describe the problem.

--
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.




--
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.




  #12   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default How can I set an automated form to show/hide a section?

You're certainly welcome. Thanks like that are why I'm still here
after all these years.

Jay

On Tue, 15 May 2007 07:05:01 -0700, Natalie W.
wrote:

Hi Jay,

I just wanted to thank you again for everything. I cannot even begin to put
into words how grateful I am for your help. Without your direction (and your
template), I would have never figured this out. A million thanx, man.

Natalie W.

"Jay Freedman" wrote:

I was afraid you were going to ask that. :-) The answer is yes, at the cost
of additional complexity. I've modified the template and reposted it in the
same place.

The additional parts are these:

- Add two more AutoText entries, one for the unchecked box (the £ character
formatted in Wingdings2 font) and one for the checked box (the S character,
also in Wingdings2). These are named boxblank and boxx.

- Replace the single character in the code of the Macrobutton fields with an
IF field, similar to the one that makes the text in the left column appear
and disappear. In this case, the boxx value appears when the docvariable is
set to "Show", and the boxblank value appears when it's set to "Hide".

- Add a line to the macro to update this new field.

--
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.

Natalie W. wrote:
Ok, you predicted right--I've got one more question...

I know I cannot use the form checkbox in the macrobutton, but
instead, can I somehow set it up so that different characters/symbols
are displayed when the autotext is toggled on or off? For example,
when the autotext is toggled to hide, there's a box symbol, but when
the autotext is toggled to show, the symbol changes to a box with an
x in it.

"Jay Freedman" wrote:

You're certainly welcome -- but you might want to wait until you've
tried to apply the scheme to your own template, and ask more
questions
if some part of it isn't working right.

--
Jay

On Wed, 9 May 2007 15:04:00 -0700, Natalie W.
wrote:

Hi Jay,

I don't know how to put into words my gratitude for all your help.
Thank you so very much for this. I cannot thank you enough for
taking the time to do this. Truly you are a very kind human being.
I cannot praise and thank you enough.

Sincerely,

Natalie W.

"Jay Freedman" wrote:

Hi Natalie,

You can download http://jay-freedman.info/toggle.dot (save it to
disk and put it in your Templates folder, then use File New to
make a new document based on it).

The template has a lot of "moving parts" that all need to work
together based on the names you give to things:

- Each Macrobutton field is surrounded by a bookmark. The name of
the bookmark is 'ShowHide' followed by a unique number.

- For each macro button, there is an AutoText entry stored in the
template, containing the stuff that gets shown or hidden. The name
of the AutoText must include the same number as appears in the
name of the corresponding bookmark.

- For each macro button, there is an IF field containing nested
DocVariable and AutoText fields. The DocVariable field must
contain the name of the corresponding bookmark, including the
number. The AutoText field must contain the name of the AutoText
entry.

- The IF field is surrounded by a bookmark whose name is 'Toggle'
followed by the same number as appears in the name of the
corresponding bookmark.

As long as you follow those rules, you can add more sets of
Macrobutton / fields / bookmarks / AutoText entry without having
to change anything in the macros.

This template has forms protection turned on, only so the
checkboxes within the AutoText entries will operate. If your
AutoText entries don't contain form fields, and there aren't any
form fields elsewhere in the document, then you don't have to turn
on forms protection.

--
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.

Natalie W. wrote:
Hi Jay,

Thank you so much for responding to this and for your help and
patience with me. I would like to download a real working sample
template of this if you could share.

Again, you've been tremendously helpful and thanx for sharing your
knowledge.

"Jay Freedman" wrote:

Hi Natalie,

First, resign yourself to the fact that there's no simple way to
do this job in Word, and in particular there's no way to do it
without macros.

You can use the macros in Greg's page almost exactly as they are;
just copy and paste the corrected version from this message into
a module in the form's template (follow the link
http://www.gmayor.com/installing_macro.htm to get instructions if
necessary).

Option Explicit

Const pValue_1 = "Show"
Const pValue_2 = "Hide"

Sub CallShowHide()
ShowHide Selection.Bookmarks(1).Name
End Sub


Sub ShowHide(pVarName As String)
Dim pValue As String
On Error Resume Next
pValue = ActiveDocument.Variables(pVarName).Value
On Error GoTo 0
If pValue = "" Or pValue = pValue_2 Then
pValue = pValue_1
Else
pValue = pValue_2
End If
ActiveDocument.Variables(pVarName).Value = pValue
ActiveDocument.Fields.Update
End Sub

One thing Greg neglected to discuss in the article is that there
are bookmarks surrounding the MACROBUTTON fields. Those are the
gray square brackets that you see in his screen shots. The
bookmark around the field in the first row must be named
ShowHide1 (the same as the name in the DOCVARIABLE field in the
same row), and the bookmark around the field in the second row
must be named ShowHide2. If you have more toggles, just keep
increasing the number on the end of the names.

Another thing Greg didn't address explicitly is that his method
can be used in a protected form, and the AutoText entries can
contain checkbox formfields -- but the MACROBUTTON fields that
toggle the visibility of the AutoTexts have to contain
characters that only look like check boxes or buttons, not real
checkbox formfields. You can find appropriate characters in the
Wingdings font.

If you want to see a real working template that uses this stuff,
let me know and I'll post one on a web page where you can
download it.

--
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.

On Tue, 8 May 2007 09:36:02 -0700, Natalie W.
wrote:

What I want my form to do is if a formcheckbox is selected, then
other formcheckboxes are displayed, providing more options. if
the formcheckbox is not selected (or "x"ed), then the other
formcheckboxes do not display.

I did read Greg Maxey's toggle data display, but i'm not sure
how to write the macro named showhide2 to make it do what i
want. is there any way i can do this without macros? maybe just
field codes? i've purchased 2 books (Word Bible and Step by
Step Word) and cannot find what i'm looking for. I know i
probably sound like an idiot because, if not obvious, I don't
really know what I'm talking about...I just know what i wish my
form would do.


please help me. i'm going on week 3 of trying to figure this
thing out...(hopefully that will get me some sympathy.)

"Jay Freedman" wrote:

Natalie W. wrote:
Hi all, I'm working in Word 2003 making an automated form
template (trying, anyway). Under the first question, the user
can select "new" or "existing" from the drop-down field. When
the user selects "existing," I want a section to
appear/show/drop/toggle (I'm not sure what the right verbiage
is) that will give them some options to choose from, i.e.
"existing member already has the following: (check boxes) a,
b, c, d, e"...etc. If the user selects "new," I dont want
this section to appear since it will not be applicable.

I'm brand-spanking new to the world of macros and VBE...please
keep in mind when explaining. Thanks in advance and I really
appreciate any help you can give.

Have a look at MVP Greg Maxey's page at
http://gregmaxey.mvps.org/Toggle_Data_Display.htm, and follow
the links there for additional help. If you get part way
through it and can't get something to work, post here and
describe the problem.

--
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.




--
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.





--
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
TOC field codes will not hide when commanded by HIDE/SHOW tile. RECONSMITH Microsoft Word Help 1 February 22nd 07 09:24 PM
Can I Show/ Hide Hidden text by Section editor Microsoft Word Help 2 October 12th 06 10:22 AM
show/hide section depending on number of pages in section ivory_kitten Page Layout 7 June 13th 06 11:59 AM
Hide page numbers in Section 1 continue Section 2 normally [email protected] Page Layout 1 May 22nd 06 10:55 PM
the tab indication doesn't show via Show/Hide ¶ button Jack Microsoft Word Help 2 December 4th 04 10:07 PM


All times are GMT +1. The time now is 03:24 AM.

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"