Click here to Skip to main content
16,018,057 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Create Multi Series Chart in VB.net Pin
Richard Deeming22-Nov-20 22:22
mveRichard Deeming22-Nov-20 22:22 
Questionneed some guidance and advice to build a questionnaire system similar to Google forms in vb.net or c# and sql server Pin
albasheer210019-Nov-20 18:05
albasheer210019-Nov-20 18:05 
AnswerRe: need some guidance and advice to build a questionnaire system similar to Google forms in vb.net or c# and sql server Pin
Richard MacCutchan19-Nov-20 22:14
mveRichard MacCutchan19-Nov-20 22:14 
AnswerRe: need some guidance and advice to build a questionnaire system similar to Google forms in vb.net or c# and sql server Pin
CHill6020-Nov-20 1:59
mveCHill6020-Nov-20 1:59 
QuestionSend a file via a bot telegram vb.net Pin
Member 1496222414-Nov-20 11:33
Member 1496222414-Nov-20 11:33 
AnswerRe: Send a file via a bot telegram vb.net Pin
Dave Kreskowiak14-Nov-20 12:14
mveDave Kreskowiak14-Nov-20 12:14 
QuestionChanging the color of specific text and selecting visual basics word Pin
DaniOM9-Nov-20 1:25
DaniOM9-Nov-20 1:25 
AnswerRe: Changing the color of specific text and selecting visual basics word Pin
CHill6017-Nov-20 23:59
mveCHill6017-Nov-20 23:59 
The code you have shared works perfectly - it finds all text coloured red and replaces it with blank. Which according to the "comment" in the code, and the title of your post, is what it is meant to do.

If you want to get a collection of all of the text in red to do something else with it then try something like this
VB
Sub EditFindLoopExample()
'Based on example from Microsoft Support
'https://support.microsoft.com/en-gb/help/306338/sample-macro-that-uses-a-loop-to-find-text-in-word-documents
    Dim c As Collection
    Set c = New Collection
    With ActiveDocument.Content.Find
        .ClearFormatting
        .Font.Color = wdColorRed    'Search for red text
        'Loop through all red text one item at a time
        Do While .Execute(Forward:=True, Format:=True) = True
            With .Parent
                If .End = ActiveDocument.Content.End Then
                    Exit Do
                Else
                    c.Add .Text
                End If
            End With
        Loop
    End With
    
    'Collection c now contains all the text in red
    '<<<< replace from here with paste to another document >>>>>
    Dim s As Variant
    For Each s In c
        Debug.Print s
    Next
End Sub
Here is the link to the Microsoft Support example [^] this was based on -
QuestionProblem in sending sms Pin
Member 137109127-Nov-20 4:44
Member 137109127-Nov-20 4:44 
AnswerRe: Problem in sending sms Pin
Richard Andrew x647-Nov-20 8:46
professionalRichard Andrew x647-Nov-20 8:46 
QuestionProblem receiving hex value on serialport Pin
Member 102013576-Nov-20 3:23
Member 102013576-Nov-20 3:23 
QuestionDim objNewItem As ComboItem Pin
empalamado4-Nov-20 7:00
empalamado4-Nov-20 7:00 
AnswerRe: Dim objNewItem As ComboItem Pin
Victor Nijegorodov4-Nov-20 7:51
Victor Nijegorodov4-Nov-20 7:51 
AnswerRe: Dim objNewItem As ComboItem Pin
Dave Kreskowiak4-Nov-20 8:39
mveDave Kreskowiak4-Nov-20 8:39 
QuestionNaming added Controls Pin
Member 1495490329-Oct-20 12:00
Member 1495490329-Oct-20 12:00 
AnswerRe: Naming added Controls Pin
Gerry Schmitz29-Oct-20 13:44
mveGerry Schmitz29-Oct-20 13:44 
GeneralRe: Naming added Controls Pin
Member 1495490329-Oct-20 13:49
Member 1495490329-Oct-20 13:49 
GeneralRe: Naming added Controls Pin
Gerry Schmitz30-Oct-20 7:25
mveGerry Schmitz30-Oct-20 7:25 
QuestionFail to call Sub from Async method Pin
Mc_Topaz27-Oct-20 23:38
Mc_Topaz27-Oct-20 23:38 
AnswerRe: Fail to call Sub from Async method Pin
Richard Deeming28-Oct-20 1:12
mveRichard Deeming28-Oct-20 1:12 
GeneralRe: Fail to call Sub from Async method Pin
Mc_Topaz28-Oct-20 1:59
Mc_Topaz28-Oct-20 1:59 
QuestionCannot insert into Oracle 11g R2 Pin
kerek224-Oct-20 18:14
kerek224-Oct-20 18:14 
AnswerRe: Cannot insert into Oracle 11g R2 Pin
Victor Nijegorodov24-Oct-20 20:40
Victor Nijegorodov24-Oct-20 20:40 
GeneralRe: Cannot insert into Oracle 11g R2 Pin
kerek225-Oct-20 12:47
kerek225-Oct-20 12:47 
GeneralRe: Cannot insert into Oracle 11g R2 Pin
Dave Kreskowiak25-Oct-20 14:09
mveDave Kreskowiak25-Oct-20 14:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.