Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 10-15-2015, 05:27 PM
rogelinepaula rogelinepaula is offline Can't reset form fields (Word 2013) and conditional formatting Windows 8 Can't reset form fields (Word 2013) and conditional formatting Office 2013
Novice
Can't reset form fields (Word 2013) and conditional formatting
 
Join Date: May 2015
Posts: 22
rogelinepaula is on a distinguished road
Default



This is what I have--the N/R is the one from the Legacy Tools and still has 2 more options and the Choose an item is a content control. The arrow beside it is what I am not seeing in the Legacy drop-down to show the options.
Reply With Quote
  #17  
Old 10-15-2015, 05:32 PM
rogelinepaula rogelinepaula is offline Can't reset form fields (Word 2013) and conditional formatting Windows 8 Can't reset form fields (Word 2013) and conditional formatting Office 2013
Novice
Can't reset form fields (Word 2013) and conditional formatting
 
Join Date: May 2015
Posts: 22
rogelinepaula is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
If you're referring to the formfield you have against the 'Does the offence involve violence or threat of violence?' question, which is the only such formfield you have in the document, all you need do is apply the 'filling in forms' editing restrictions.

That said, I see that all your other questions have dropdown content controls. You really should stick to one kind of control - formfields and content controls don't work well together. Unlike formfields, content controls don't require the 'filling in forms' editing restrictions to work. And, since you'll need macros for what you want to do, you could just as well use content controls throughout. In some respects, that would make coding for the conditional formatting simpler, too.
I see and thank you--I was really planning to do the content-control because it's a lot easier. For the codes you've helped me with, that will also work with content control right?
Reply With Quote
  #18  
Old 10-15-2015, 05:39 PM
macropod's Avatar
macropod macropod is offline Can't reset form fields (Word 2013) and conditional formatting Windows 7 64bit Can't reset form fields (Word 2013) and conditional formatting Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by rogelinepaula View Post
For the codes you've helped me with, that will also work with content control right?
No, but it wouldn't require much effort to re-code for use with the content controls. I'll post back with some later.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #19  
Old 10-15-2015, 05:43 PM
rogelinepaula rogelinepaula is offline Can't reset form fields (Word 2013) and conditional formatting Windows 8 Can't reset form fields (Word 2013) and conditional formatting Office 2013
Novice
Can't reset form fields (Word 2013) and conditional formatting
 
Join Date: May 2015
Posts: 22
rogelinepaula is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
No, but it wouldn't require much effort to re-code for use with the content controls. I'll post back with some later.
Thank you so much, Paul. I will wait for your update and hopefully you can post a code that's based on the document I've attached earlier and then I'll follow your format for the rest of the content control drop-down boxes. You've been very patient--much appreciated.
Reply With Quote
  #20  
Old 10-15-2015, 06:58 PM
macropod's Avatar
macropod macropod is offline Can't reset form fields (Word 2013) and conditional formatting Windows 7 64bit Can't reset form fields (Word 2013) and conditional formatting Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Assuming all the dropdowns are meant to have the same conditional shading outcomes, the following code is all you'll need.
Code:
Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean)
Application.ScreenUpdating = False
Dim lClr As Long
With CCtrl
  If .Type <> wdContentControlDropdownList Then Exit Sub
  With .Range
    If .Information(wdWithInTable) = False Then Exit Sub
    Select Case .Text
      Case "N/R":  lClr = wdColorLightTurquoise
      Case "Yes": lClr = wdColorPink
      Case "No": lClr = wdColorBrightGreen
      Case Else: lClr = wdColorAutomatic
    End Select
    .Cells(1).Range.Shading.BackgroundPatternColor = lClr
  End With
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #21  
Old 10-15-2015, 07:15 PM
rogelinepaula rogelinepaula is offline Can't reset form fields (Word 2013) and conditional formatting Windows 8 Can't reset form fields (Word 2013) and conditional formatting Office 2013
Novice
Can't reset form fields (Word 2013) and conditional formatting
 
Join Date: May 2015
Posts: 22
rogelinepaula is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
See attached. Assuming all the dropdowns are meant to have the same conditional shading outcomes, the included code is all you'll need.
WOW! Thank you so much, Paul! Yes--all the options are meant to have the same shadings. I'll just add the other options and will assign a color. My last question--do you have a link or a quick reference of the list of colors that I can use in VBA? I COULDN'T THANK YOU ENOUGH FOR ALL YOUR HELP.
Reply With Quote
  #22  
Old 10-15-2015, 07:33 PM
macropod's Avatar
macropod macropod is offline Can't reset form fields (Word 2013) and conditional formatting Windows 7 64bit Can't reset form fields (Word 2013) and conditional formatting Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by rogelinepaula View Post
do you have a link or a quick reference of the list of colors that I can use in VBA?
There are 16,777,216 possible colours, any of which can be specified by using VBA's RGB function. That'd make a pretty big list. That said, the BackgroundPatternColor property comes with a bunch of named presets. You can see what those are by inputting WdColor into the VBE Help screen.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #23  
Old 10-15-2015, 10:00 PM
rogelinepaula rogelinepaula is offline Can't reset form fields (Word 2013) and conditional formatting Windows 8 Can't reset form fields (Word 2013) and conditional formatting Office 2013
Novice
Can't reset form fields (Word 2013) and conditional formatting
 
Join Date: May 2015
Posts: 22
rogelinepaula is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
There are 16,777,216 possible colours, any of which can be specified by using VBA's RGB function. That'd make a pretty big list. That said, the BackgroundPatternColor property comes with a bunch of named presets. You can see what those are by inputting WdColor into the VBE Help screen.
Many thanks for all your help, Paul! And to those who have replied as well. Closing this case now. Glad to be part of this community.
Reply With Quote
  #24  
Old 01-07-2016, 02:44 PM
Maria Hernandez's Avatar
Maria Hernandez Maria Hernandez is offline Can't reset form fields (Word 2013) and conditional formatting Windows 7 32bit Can't reset form fields (Word 2013) and conditional formatting Office 2013
Novice
 
Join Date: Jan 2016
Location: Bakersfield, CA
Posts: 1
Maria Hernandez is on a distinguished road
Default

So I'm having a similar issue. I have a Word 2013 document, but I've used the "Rich Text Content Control" button for Data Entry. I've also tried with the Legacy tool box text form. But I can't get them to clear without closing and opening the document. My process is, I type the necessary info, print it, then I want to click a button to reset it (clear all controls) but that Eraser doesn't work, nor does this VBA

Sub ClearFormFields()
Dim FF As FormField
For Each FF In ActiveDocument.FormFields
Select Case FF.Type
Case wdFieldFormTextInput
FF.Result = ""
Case wdFieldFormCheckBox
FF.CheckBox.Value = False
Case wdFieldFormDropDown
FF.DropDown.Value = 1
Case Else
' do nothing
End Select
Next
End Sub

Document is not protected, currently saved as a Macro enable Template.
Reply With Quote
  #25  
Old 01-07-2016, 03:54 PM
macropod's Avatar
macropod macropod is offline Can't reset form fields (Word 2013) and conditional formatting Windows 7 64bit Can't reset form fields (Word 2013) and conditional formatting Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You say you're using the "Rich Text Content Control" button for Data Entry and that the Document is not protected, but your macro is for use with formfields, not content controls, and formfields only work when a document is protected.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to keep formatted form fields after mail merge or replace text with formatted form fields jer85 Word VBA 2 04-05-2015 10:00 PM
Can't reset form fields (Word 2013) and conditional formatting Reinstalling Office 2013 after factory reset barryd Office 1 05-17-2013 04:24 PM
Form Fields in Word jwm1346 Word 1 04-17-2012 07:02 PM
Can't reset form fields (Word 2013) and conditional formatting Preventing Form Fields to Reset PosseJohn Word VBA 4 07-15-2011 09:44 PM
Form fields in Word messed up mba Word VBA 0 02-07-2010 09:54 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09: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