Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-17-2013, 08:26 AM
Pierre-Hugues Pierre-Hugues is offline is there a way to link check boxes with real text Windows 8 is there a way to link check boxes with real text Office 2013
Novice
is there a way to link check boxes with real text
 
Join Date: Jun 2013
Posts: 8
Pierre-Hugues is on a distinguished road
Default is there a way to link check boxes with real text


Hi guys
I do a lot of reports and I am tired of having to redo every one of them since they are the same or different at the same time...
roughly what I would like to do is have a bunch of check boxes and depending if they are activated or not have the text that would be related to the box automatically follow...
ex: if choose box 1 = text 1, box 2 = text 2, box 1-2 = text 3
would that be possible in Word...
I know it would be in Excel but I would really need it in Word

Thanks for your help and I am sorry for any misspelling I am french and I dislike Google translate
Reply With Quote
  #2  
Old 06-17-2013, 01:41 PM
Charles Kenyon Charles Kenyon is offline is there a way to link check boxes with real text Windows Vista is there a way to link check boxes with real text Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Probably the most straight-forward way would be a UserForm which is a vba custom dialog box.
Create a Simple Userform

Any method is going to involve either complex IF fields and/or vba programming. The UserForm is the most elegant method.
Reply With Quote
  #3  
Old 06-17-2013, 03:17 PM
Pierre-Hugues Pierre-Hugues is offline is there a way to link check boxes with real text Windows 8 is there a way to link check boxes with real text Office 2013
Novice
is there a way to link check boxes with real text
 
Join Date: Jun 2013
Posts: 8
Pierre-Hugues is on a distinguished road
Default

I will try it I haven't programmed in VBA for about 10 years but if are pretty simple

Thanks
Reply With Quote
  #4  
Old 06-18-2013, 08:41 AM
Charles Kenyon Charles Kenyon is offline is there a way to link check boxes with real text Windows Vista is there a way to link check boxes with real text Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

You can store your text for insertion in AutoText entries or simply make it a part of your checkbox result in the userform. If I want to format what is typed in response to the checkbox in a certain way, I usually do it by storing the text as an AT entry and inserting that instead.
Reply With Quote
  #5  
Old 06-25-2013, 09:44 AM
Pierre-Hugues Pierre-Hugues is offline is there a way to link check boxes with real text Windows 8 is there a way to link check boxes with real text Office 2013
Novice
is there a way to link check boxes with real text
 
Join Date: Jun 2013
Posts: 8
Pierre-Hugues is on a distinguished road
Default

Good Idea I haden't thaught about AT entry...
I will look into how to link it from the userform checkbox to a word document
Thanks you
Reply With Quote
  #6  
Old 06-26-2013, 07:27 AM
Charles Kenyon Charles Kenyon is offline is there a way to link check boxes with real text Windows Vista is there a way to link check boxes with real text Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Here is code I use in a UserForm with four checkboxes. It is almost ten years old but it works in Word 2003-2013.

Code:
Option Explicit

Private Sub cmdCancel_Click()
    Me.Hide
    Unload Me
End Sub

Private Sub cmdHelp_Click()
    frmHelp.Show
End Sub

Private Sub cmdOK_Click()
    If chkAlcohol.Value = True Then
        MsgBox "Alcohol checked"
    End If
    If chkDNA.Value = True Then
        UpdateBookmark "DxDNAdemand", "DxDNAdemand"
        UpdateBookmark "DxDNAdemanda", "DxDNAdemand"
        UpdateBookmark "DxDNAnotice", "DxDNAnotice"
        Else
        ClearBookmark "DxDNAdemand"
        ClearBookmark "DxDNAdemanda"
        ClearBookmark "DxDNAnotice"
    End If
    If chkOWI.Value = True Then
        UpdateBookmark "DxDWI1a", "DxDWI1a"
        UpdateBookmark "DxDWI1b", "DxDWI1b"
        UpdateBookmark "DxDWI1c", "DxDWI1c"
        UpdateBookmark "DxDWI1d", "DxDWI1d"
        UpdateBookmark "DxDWI2", "DxDWI2"
        UpdateBookmark "DxDWI3", "DxDWI3"
        Else
        ClearBookmark "DxDWI1a"
        ClearBookmark "DxDWI1b"
        ClearBookmark "DxDWI1c"
        ClearBookmark "DxDWI1d"
        ClearBookmark "DxDWI2"
        ClearBookmark "DxDWI3"
    End If
    If chkSA.Value = True Then
        UpdateBookmark "DxSAkit", "DxSAkit"
        UpdateBookmark "DxSAprotocol", "DxSAprotocol"
        UpdateBookmark "DxSAprotocola", "DxSAprotocol"
        UpdateBookmark "DxSAprotocolb", "DxSAprotocol"
        UpdateBookmark "DxSAprotocolc", "DxSAprotocol"
        Else
        ClearBookmark "DxSAkit"
        ClearBookmark "DxSAprotocol"
        ClearBookmark "DxSAprotocola"
        ClearBookmark "DxSAprotocolb"
        ClearBookmark "DxSAprotocolc"
    End If
    cmdCancel_Click
End Sub

Private Sub UserForm_Click()

End Sub

Private Sub UpdateBookmark(ByVal strBookmarkName As String, _
    ByVal strAutoTextName As String)
'   from http://word.mvps.org/FAQs/MacrosVBA/InsertingTextAtBookmark.htm
'   modified to use AutoText by Charles Kenyon on 6 Feb 2004
'   modified to use AutoText.Insert with help from Peter Hewitt on 25 Feb 2004
'
    Dim rngLocation As Word.Range
    Dim tplAttached As Word.Template
'
    Set tplAttached = ActiveDocument.AttachedTemplate
    Set rngLocation = ActiveDocument.Bookmarks(strBookmarkName).Range
    Set rngLocation = tplAttached. _
        AutoTextEntries(strAutoTextName).Insert(rngLocation, True)
    ActiveDocument.Bookmarks.Add strBookmarkName, rngLocation
    tplAttached.Saved = True
End Sub

Private Sub ClearBookmark(BookmarkToUpdate As String)
    Dim BMRange As Range
    Set BMRange = ActiveDocument.Bookmarks(BookmarkToUpdate).Range
    BMRange.Text = ""
    ActiveDocument.Bookmarks.Add BookmarkToUpdate, BMRange
End Sub
Reply With Quote
  #7  
Old 09-26-2013, 11:35 AM
Pierre-Hugues Pierre-Hugues is offline is there a way to link check boxes with real text Windows 8 is there a way to link check boxes with real text Office 2013
Novice
is there a way to link check boxes with real text
 
Join Date: Jun 2013
Posts: 8
Pierre-Hugues is on a distinguished road
Default

Thanks for the info
Reply With Quote
  #8  
Old 09-26-2013, 03:52 PM
Charles Kenyon Charles Kenyon is offline is there a way to link check boxes with real text Windows Vista is there a way to link check boxes with real text Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

You are welcome.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word2010 check boxes and plain text content control boxes in same table fcsungard Word 5 06-01-2012 01:16 AM
Link word check box to access check box Mrkieth Word 4 01-30-2012 06:43 AM
is there a way to link check boxes with real text Check Boxes jellyrolls Office 4 07-15-2011 08:07 PM
Link 2 form items (for ex check box and a text box) dzn Word 0 07-19-2010 01:58 AM
Problem with Developer Form -- Check Boxes and Text Boxes PCC Word 1 05-16-2009 05:22 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:44 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft