|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Word Macro That Checks a Check Box Form Field When File Print is Executed
Title (mostly) says it all, folks. I've tried and (repeatedly) failed to reverse-engineer a template that used to contain commands that performed two distinct actions upon file print (related screen shot is attached):
I imagine there's a simple solution, but damned if I can't figure it out. Thanks in advance for your assistance. |
#2
|
||||
|
||||
Why are you unable to use the previous userform (that's what you've posted an image of, not a document template)? What part of the project are you having trouble with? Creating the whole userform & code, checking the checkbox status, or updating the checkbox status?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Quote:
I'm not hung up on using the existing userform, etc., I really just need something, anything, that allows me to uncheck a checked box and check an unchecked box whenever the document is sent to print. I'm a total novice when it comes to coding/macros/VBA, and the person who initially created this document is long, long gone. Any help you or anyone else can provide is much appreciated. Thanks again! |
#4
|
||||
|
||||
OK, so you have an existing userform, about which you previously said it "used to contain commands that performed two distinct actions". Has it stopped working? have you tried re-installing whatever application/add-in it's part of?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Does this help
I am a novice at VBA and I was looking to do something smiliar and found this method.
I wanted a dropdown to set the relevant checkbox. Initially I read that you cannot set checkbox values, but eventually found that you can and how from here from which I created the following code Hope it helps.? Code:
Function SetChkType() Dim strType As String Dim oFFld As FormFields strType = ActiveDocument.FormFields("lstType").Result Set oFFld = ActiveDocument.FormFields ' Initialise checkboxes to empty (False) oFFld("chkAnswer").CheckBox.Value = False oFFld("chkPhone").CheckBox.Value = False oFFld("chkVisit").CheckBox.Value = False oFFld("chkLetter").CheckBox.Value = False oFFld("chkRefer").CheckBox.Value = False oFFld("chkEmail").CheckBox.Value = False ' Now set the correct one to True Select Case strType Case "A" oFFld("chkAnswer").CheckBox.Value = True Case "T" oFFld("chkPhone").CheckBox.Value = True Case "P" oFFld("chkVisit").CheckBox.Value = True Case "L" oFFld("chkLetter").CheckBox.Value = True Case "R" oFFld("chkRefer").CheckBox.Value = True Case "E" oFFld("chkEmail").CheckBox.Value = True End Select End Function |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word Macro: Save file as text with current file name | jabberwocky12 | Word VBA | 2 | 10-22-2010 12:23 PM |
Print Macro in MS Word | steve207 | Word VBA | 0 | 09-10-2010 02:11 AM |
Custom Form Check Box's | shogan | Word | 1 | 05-14-2010 09:00 PM |
How to Cross reference a check box in a form | janene_vaughn | Word | 0 | 12-29-2009 12:34 PM |
Converting a check box form into text | tmcii82 | Word VBA | 0 | 11-20-2009 08:47 AM |