Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-04-2023, 12:12 PM
kevinbradley57 kevinbradley57 is offline Unable to abbreviate "Strong" Windows 7 64bit Unable to abbreviate "Strong" Office 2010 64bit
Advanced Beginner
Unable to abbreviate "Strong"
 
Join Date: Jul 2017
Posts: 89
kevinbradley57 is on a distinguished road
Default Unable to abbreviate "Strong"


I have a dropdown content control in a table cell. The font and background color change based on the selection made. One of the dropdown options is "Strong" and that works fine. I have a request to abbreviate it as "Str" but when I make that change in the VB and in the dropdown, either the background and font colors are both white or it's returning a blank cell (I can't tell which).
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
With ContentControl
      Case "CE"
      Select Case .Range.Text
        Case "Strong": .Range.Cells(1).Shading.BackgroundPatternColor = 6299648: .Range.Cells(1).Range.Font.ColorIndex = wdWhite
        Case "Weak": .Range.Cells(1).Shading.BackgroundPatternColor = 4739264: .Range.Cells(1).Range.Font.ColorIndex = wdWhite
        Case "Sat": .Range.Cells(1).Shading.BackgroundPatternColor = 5880731: .Range.Cells(1).Range.Font.ColorIndex = wdBlack
        Case "IN": .Range.Cells(1).Shading.BackgroundPatternColor = 5232127: .Range.Cells(1).Range.Font.ColorIndex = wdBlack
        Case Else: .Range.Cells(1).Shading.BackgroundPatternColorIndex = wdNoHighlight
      End Select
    Case Else
  End Select
End With
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003: VBA "Function" causes "#VALUE!" errors after running "insert/delete row" custom macro Matt C Excel Programming 2 01-08-2022 06:03 AM
Unable to customize ribbon, remove "Cell Styles" pjs15 Excel 1 08-21-2020 08:01 AM
Unable to abbreviate "Strong" When applying styles word is automatically reverting to "strong" style partway through my document Victoria S Word 3 11-17-2015 12:51 PM
Message "Unable to read file" when clicking on the Excel icon roundman Excel 3 12-03-2014 04:28 PM
Unable to "Shift cells down" on unprotected area in a protected worksheet ricky0309 Excel 0 08-14-2014 01:51 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:27 PM.


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