Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getfile and Microsoft Word doc s
#1
I need to be able to search and extract phrases within a bunch of MS Word docs but 'getfile' doesn't seem to be able to pull them apart. Is there a function for doing this?
An old blog on QM coding and automation.

The Macro Hook
#2
Don't know what is "pull them apart" in English.

If getfile error, close Word.

If don't know how to search because it is binary etc, get from where text begins and convert UTF-16 to UTF-8.

Macro Macro1195
Code:
Copy      Help
out
str s.getfile("C:\Users\G\Documents\Notes.doc" 3000)
;s.findreplace("" " " 32)
s.ansi
out s

Or use Word type library functions, if possible.
#3
"pull apart" you pretty much figured out what it means.
I have a doc that is several pages long and here's what I get when I do a standard 'out' on it only you can't see the unicode chars in the forum :?
Quote:ࡱ

I tried the ansi but it's about the same. i may have to go to PowerGrep.

thanks.
An old blog on QM coding and automation.

The Macro Hook
#4
Macro Macro1195
Code:
Copy      Help
out
;str s.getfile("C:\Users\G\Documents\Notes.doc" 3000)
str s.getfile("C:\Users\G\Documents\Notes.doc" 0)
;s.findreplace("" " " 32)
s.ansi(s _unicode s.len/2)
s.findreplace("" " " 32)
out s
#5
thanks, I gave it a shot and it's still not working. prob should use the API.

thanks.
An old blog on QM coding and automation.

The Macro Hook
#6
I took out the line
Code:
Copy      Help
s.ansi(s _unicode s.len/2)
and it works great now. Ugly when it's out'ed but I can find the text!!!!
An old blog on QM coding and automation.

The Macro Hook


Forum Jump:


Users browsing this thread: 1 Guest(s)