Avatar of Saqib Husain
Saqib HusainFlag for Pakistan

asked on 

Word VBA: Finding text with a particular color.

Can someone give me code to get the font color at the current cursor position and then look for the next text with the same color?
Microsoft Word

Avatar of undefined
Last Comment
Saqib Husain
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Peter Chan
Peter Chan
Flag of Hong Kong image

Here is an example to get font color

Worksheets("Code Sheet").Cells(i, 1).Font.Color

Open in new window

Here is one other example to find out one specific string

    Set c1 = Worksheets("Code Sheet3").Cells.Find(Para_Country)

    If Not c1 Is Nothing Then
        Worksheets("Budget-Report-HO").Cells(3, 5).Value = Worksheets("Code Sheet3").Cells(c1.Row, 2).Value
    Else
        Exit Sub
    End If

Open in new window

Avatar of Rgonzo1971
Rgonzo1971

@HuaMinChen Word VBA not Excel VBA
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

ASKER

Just perfect, thanks.
Avatar of Rgonzo1971
Rgonzo1971

Word or Excel I'm confused...
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

ASKER

Sorry, wrong answer accepted. I cannot find the request attention button.
Avatar of Rgonzo1971
Rgonzo1971

Maybe the flag "report"
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

ASKER

Yes, I already did that.
Microsoft Word
Microsoft Word

Microsoft Word is a commercial document editing program that is part of the Microsoft Office suite. It features numerous text-editing tools for creating richly formatted documents, along with tools for the use of macros in Word documents. Word's native file formats are denoted either by a .doc or .docx file extension. Plugins permitting the Windows versions of Word to read and write formats it does not natively support, such as the OpenDocument format (ODF) are available. Word can import and display images in common bitmap formats such as JPG and GIF. It can also be used to create and display simple line-art.

30K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo