View Single Post
  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How to create a text box and combo box within

See http://www.gmayor.com/installing_macro.htm for instructions on using
macro listings and
http://www.gmayor.com/Macrobutton.htm and
http://gregmaxey.mvps.org/Add_Toggle_Objects.htm explain the creation of
checkable boxes.

--

Graham Mayor - Word MVP

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




Eric wrote:
Thank everyone very much for suggestions
I see the Macro coding, but I still don't know how to create a
checkbox in word.
I have tried to create a checkbox, but get no idea on how to work on
the macro coding related to this checkbox.
Does anyone have any suggestions on how to do it?
Thank everyone very much for any suggestions
Eric

http://addbalance.com/word/download.htm#PageStart
http://addbalance.com/word/download/...oxtemplate.zip
CheckBox REF Substitute.doc

Macro Coding for checkbox
Option Explicit

Sub CopyCheckBoxMacro()
' Macro written by Charles Kenyon
' 21 December 2001 revised 11 January 2002
'
' Declare variables
Dim sCheck As String
Dim bCheck As Boolean
Dim sChecka As String
Dim sCheckb As String
'
' Get name and value of formfield which was just used and
' set variable for dependent formfield name
sCheck = Selection.FormFields.Item(1).Name
sChecka = sCheck & "a"
sCheckb = sCheck & "b"
bCheck = ActiveDocument.FormFields(sCheck).CheckBox.Value
'
' Unprotect document
ActiveDocument.Unprotect
'
' Set value for dependent checkboxes and reprotect document
ActiveDocument.FormFields(sChecka).CheckBox.Value = bCheck
ActiveDocument.FormFields(sCheckb).CheckBox.Value = bCheck
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End Sub



Option Explicit

Sub CopyCheckBoxMacro()
' Macro written by Charles Kenyon
' 21 December 2001 revised 11 January 2002
'
' Declare variables
Dim sCheck As String
Dim bCheck As Boolean
Dim sChecka As String
Dim sCheckb As String
'
' Get name and value of formfield which was just used and
' set variable for dependent formfield name
sCheck = Selection.FormFields.Item(1).Name
sChecka = sCheck & "a"
sCheckb = sCheck & "b"
bCheck = ActiveDocument.FormFields(sCheck).CheckBox.Value
'
' Unprotect document
ActiveDocument.Unprotect
'
' Set value for dependent checkboxes and reprotect document
ActiveDocument.FormFields(sChecka).CheckBox.Value = bCheck
ActiveDocument.FormFields(sCheckb).CheckBox.Value = bCheck
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End Sub


"Doug Robbins - Word MVP" wrote:

Get the Checkbox Add-in that can be down loaded from Charles Kenyon's
website at:

http://addbalance.com/word/download.htm#PageStart


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Eric" wrote in message
...
Thank you very much for your suggestions
Could you please tell me where I can find the option for checkbox
formfield
to be inserted in word?
Thank you very much for any suggestions
Eric

"Doug Robbins - Word MVP" wrote:

Insert a Checkbox formfield alongside each item that you want the
user to be
able to select.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of
my services on a paid consulting basis.

Doug Robbins - Word MVP

"Eric" wrote in message
...
Does anyone have any suggestions on how to create combo box
within word document?
For example, how to create a list of options, and would like to
create a
square box, if people click on it, it will display a cross for
selected items, and they can select more than one box at the same
time.
Does anyone have any suggestions on how to create this features
on word documents?
Thanks in advance for any suggestions
Eric