#1
|
|||
|
|||
Find/Replace letters with color change
Hello, I am new here - since I have not found a solution for my problem after a long search, I hope that somebody can help me here.
I have a (longish) power point presentation and would like to color specific letters differently from the others. (e.g. word => word)). I do not want to use the normal find and replace tool and manually change the color for every single letter but am looking for something like the special find and replace options word provides for (where it is possible to e.g. change to bold and/or italic and/or different color). Do you have any idea how this can be done? As an additional information: i use mac but also have a pc that i can use. also, if I have to buy an newer version of power point to solve the problem, this is not an issue. Thank you a lot in advance! M |
#2
|
|||
|
|||
PPT doesn't have the special find option that you can use in word. You might be able to use code but you would need to describe EXACTLY what you want to happen.
|
#3
|
|||
|
|||
thanks a lot for the reply and the hint to the code. As to the code: I have a text and I want to change the color of all lower case consonants within the text (whereas the color of the remaining letters shall remain as it is). More specifically, I want to change the color of the letters from white to black (it is a ppt with black background). The idea is to get a text with missing letters that have to be completed by the readers (but can be shown if needed). Does that help or would you need more specific information?
best |
#4
|
|||
|
|||
This is off the top of my head and I don't have a Mac. (Don't think 2008 supports vba code) Use on a copy anyway.
Also it will NOT search tables, smart art etc just simple text in placeholders or textboxes. Code:
Sub findLCConsonants() Dim osld As Slide Dim oshp As Shape Dim L As Long For Each osld In ActivePresentation.Slides For Each oshp In osld.Shapes If oshp.HasTextFrame Then If oshp.TextFrame.HasText Then For L = 1 To oshp.TextFrame.TextRange.Length Select Case Asc(oshp.TextFrame.TextRange.Characters(L)) 'less than 97 or > 122 are not lowercase '65,101,105,111,117 are vowels Case Is < 97, 65, 101, 105, 111, 117, Is > 122 'do nothing Case Else oshp.TextFrame.TextRange.Characters(L).Font.Color.RGB = RGB(0, 0, 0) End Select Next L End If End If Next oshp Next osld End Sub |
#5
|
|||
|
|||
You're great, thanks! it works perfectly well!!
i have now tried to inverse the code (i.e. vowels shall be black instead of consonants) but am miserably failing... can you maybe also help me with this? Thans a lot!! |
#6
|
|||
|
|||
That would actually be easier! If you also want UPPER CASE vowels you would need to add the upper case codes 65 ,69,73,79,85
Code:
Sub findLCVowels() Dim osld As Slide Dim oshp As Shape Dim L As Long For Each osld In ActivePresentation.Slides For Each oshp In osld.Shapes If oshp.HasTextFrame Then If oshp.TextFrame.HasText Then For L = 1 To oshp.TextFrame.TextRange.Length Select Case Asc(oshp.TextFrame.TextRange.Characters(L)) '97,101,105,111,117 are vowels Case Is = 97, 101, 105, 111, 117 ' lower case vowels oshp.TextFrame.TextRange.Characters(L).Font.Color.RGB = RGB(0, 0, 0) Case Else 'do nothing End Select Next L End If End If Next oshp Next osld End Sub |
#7
|
|||
|
|||
Dear JohnWilson
Thank you so much - the code works and has saved me (or my boyfriend respectively) a great deal of time! I wish you a good end of the easter weekend!! Best, M |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to use find and replace to change text to a custom style | wrdy | Word | 7 | 03-11-2014 12:09 AM |
Find instance of a word in a specific style and change its color | hwg | Word VBA | 7 | 02-20-2014 10:59 PM |
how to search and replace BOLD text >> font color change? | dylansmith | Word | 4 | 03-12-2013 09:51 PM |
remove color from find/replace? | Cobb78 | Word | 1 | 05-26-2012 06:16 PM |
Find and Replace - Variable change | Ssendam | Excel | 1 | 07-16-2009 11:44 AM |