Recent

Author Topic: Accessing MS WordPad programmatically?  (Read 484 times)

AgriMensor

  • New Member
  • *
  • Posts: 35
Accessing MS WordPad programmatically?
« on: October 04, 2022, 05:02:26 pm »
Hi!

Does anyone have experience of being able to partially automate WordPad, please?

I need to look for specific words in the text and then highlight them (by font color and/or by shading).

I'm able to do it using the RichMemo component, but need to get inside WordPad now. Thanks to the generosity of other forum contributors, I can now also do it for MS Word.

Thanks in advance for any assistance!

Steve

Leledumbo

  • Hero Member
  • *****
  • Posts: 8747
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Accessing MS WordPad programmatically?
« Reply #1 on: October 12, 2022, 11:54:17 am »
AFAIK WordPad is not covered by the same automation that MS Office enjoys, but I could be wrong. In the meantime, you can use MouseAndKeyInput package alongside TProcess (as you will need its process ID to bring the window to front so keyboard and mouse actions are applied to it instead of your own app).

Thaddy

  • Hero Member
  • *****
  • Posts: 14213
  • Probably until I exterminate Putin.
Re: Accessing MS WordPad programmatically?
« Reply #2 on: October 12, 2022, 06:24:02 pm »
AFAIK WordPad is not covered by the same automation that MS Office enjoys,
Actually it IS and almost complete too: you will need to import the TOM interfaces. I wrote that about ( well exactly ) in 2004 for KOL and separately for plain Delphi.
This goes for the simple RE2 up until today's MsFtEdit.dll. There is also an example by me for FPC, but using the Delphi *.tlb importer.
RichEdit2 had some small issues which were later corrected.
« Last Edit: October 12, 2022, 06:28:58 pm by Thaddy »
Specialize a type, not a var.

 

TinyPortal © 2005-2018