Jump to content

MS-Word Doc: searching for a certain formated place/string


logo78
 Share

Recommended Posts

Hi,

i found several examples and also some UDF's, but they didnt helped me really well.

Can someone give me an broad hint, how to automate the following neccessary process in a word file thorugh an AutoIT script?

  • find all places/strings which have the (font.color grey25% or grey50%) and are striken through

    and make it hidden (FontEffectsHidden Text)

  • find all places/strings which are in font.color red

    and change their font.color into black

Thanks...

:idiot:

Edited by logo78
Link to comment
Share on other sites

In VBScript this would look like:

'
' Makro3 Makro
'
'
Selection.WholeStory
Selection.Find.ClearFormatting
With Selection.Find.Font
    .StrikeThrough = True
    .DoubleStrikeThrough = False
    .Color = -603946753
End With
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Font.Hidden = True
With Selection.Find
    .Text = ""
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindAsk
    .Format = True
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub

Could you test this with Word? If it gives you the desired result it's easy to translate it to Autoit.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...