Click here to Skip to main content
15,919,423 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionIs there Access VBA method of translating text in a textbox? Pin
Member 1181158314-Dec-20 3:18
Member 1181158314-Dec-20 3:18 
AnswerRe: Is there Access VBA method of translating text in a textbox? Pin
Richard Deeming14-Dec-20 4:02
mveRichard Deeming14-Dec-20 4:02 
GeneralRe: Is there Access VBA method of translating text in a textbox? Pin
Member 1181158314-Dec-20 4:56
Member 1181158314-Dec-20 4:56 
GeneralRe: Is there Access VBA method of translating text in a textbox? Pin
Member 1181158314-Dec-20 11:41
Member 1181158314-Dec-20 11:41 
QuestionVisual Studio RDLC expression editor in the report designer and help with expressions Pin
jkirkerx5-Dec-20 10:26
professionaljkirkerx5-Dec-20 10:26 
AnswerRe: Visual Studio RDLC expression editor in the report designer and help with expressions Pin
jkirkerx5-Dec-20 13:10
professionaljkirkerx5-Dec-20 13:10 
AnswerRe: Visual Studio RDLC expression editor in the report designer and help with expressions [solved] Pin
jkirkerx6-Dec-20 9:35
professionaljkirkerx6-Dec-20 9:35 
QuestionCall a method inside a Task.Run and return the value Pin
Mc_Topaz2-Dec-20 3:03
Mc_Topaz2-Dec-20 3:03 
AnswerRe: Call a method inside a Task.Run and return the value Pin
Richard MacCutchan2-Dec-20 3:23
mveRichard MacCutchan2-Dec-20 3:23 
AnswerRe: Call a method inside a Task.Run and return the value Pin
Gerry Schmitz2-Dec-20 5:23
mveGerry Schmitz2-Dec-20 5:23 
Questionvb.net addin won't run in release mode Pin
JR21230-Nov-20 23:53
JR21230-Nov-20 23:53 
AnswerRe: vb.net addin won't run in release mode Pin
BabyYoda1-Dec-20 5:53
BabyYoda1-Dec-20 5:53 
GeneralRe: vb.net addin won't run in release mode Pin
JR2121-Dec-20 6:22
JR2121-Dec-20 6:22 
QuestionRe: vb.net addin won't run in release mode Pin
Richard MacCutchan1-Dec-20 6:36
mveRichard MacCutchan1-Dec-20 6:36 
QuestionCreate Multi Series Chart in VB.net Pin
Member 1500024122-Nov-20 21:46
Member 1500024122-Nov-20 21:46 
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 

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.