Search in Header (.DOC) (Please help convert VBA to AHK)

Get help with using AutoHotkey and its commands and hotkeys
ahklearner
Posts: 283
Joined: 23 Jan 2015, 01:49

Search in Header (.DOC) (Please help convert VBA to AHK)

Post by ahklearner » 20 Aug 2015, 04:04

Hi Community :wave:

pls help searching in header of word docs (.DOC)

Thanks in advance for your help and support.


http://stackoverflow.com/questions/9186629/searching-for-text-in-header-section-of-a-word-document

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus




;~ //========== [ ] ==========\\ --------------------------------------------- []

I found the answer on this site and it's a lot more complex than initially thought: http://word.mvps.org/faqs/customization ... ywhere.htm
The following code is from the site above, in addition to searching the entire document it includes text replace functionality:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



http://word.mvps.org/faqs/customization/ReplaceAnywhere.htm


;~ //========== [ ] ==========\\ --------------------------------------------- []


this is another example i got, but dont know how to convert to AHK

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

kon
Posts: 1756
Joined: 29 Sep 2013, 17:11

Re: Search in Header (.DOC) (Please help convert VBA to AHK)

Post by kon » 20 Aug 2015, 11:57

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

ahklearner
Posts: 283
Joined: 23 Jan 2015, 01:49

Re: Search in Header (.DOC) (Please help convert VBA to AHK)

Post by ahklearner » 21 Aug 2015, 00:56


Thanks a lot kon :clap:
you are a lifesaver, as always, :dance:


I actually need it to search an entire folder, working in background without opening word doc
something like: wdApp.Visible := false

need to FileAppend all the A_ScriptFullPath where the text is found.

it would be more beneficial if I could search in a particular line, for a particular word OR statement,
and if could not find it then collect those doc names.

I tried a lot but without any successful.

It would be more beneficial for me if you could show me a way to copy entire word content to Clipboard including header.
and I would do the rest.

something like:
file2read = c:\a.doc
MsgBox % ComObjGet(file2read).Range.Text

FilePath := "c:\c\c.doc"
ComObjGet(FilePath).Range.FormattedText.Copy


Thanks in advance for your help and cooperation.

kon wrote:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Post Reply

Return to “Ask For Help”