General information
Category:
Coding, syntax & commands
Environment versions
Network:
Windows 2008 Server
thanks Al. it would have to be contained soley in VFP environment. Using editbox in this case not quite the path I wanted but partly because I hadn't even thought of it - dragan baled me out on this one - which is approach I was using BEFORE the word search so it aligned with the process. thanks as always your input - greatly appreciated.
k
>>Is there a way to open a text document and right away place cursor next to a 'keyword'.
>>That is, is there a way to bypass the right click 'find' after the document is open.
>
>It depends on exactly what you want to do or are trying to do.
>
>If you want to open the text document within VFP you can do something like
>
>- put an Editbox on a form
>- set lcMyVar = FILETOSTR( yourtextfile )
>- use AT( ) to locate your key word
>- set .EditBox.Value = lcMyVar
>- set .EditBox.SelStart = { value you got from AT( ), if found }
>
>You might also open the text file with some program that supports automation, such as Microsoft Word. You can then use COM automation to find your keyword and move the cursor to the correct location.
>
>Opening it with a program that can't be automated (e.g. Notepad.exe) might be tricky to impossible. This would involve invoking Notepad with ShellExecute( ) or similar, then feeding keystrokes to Notepad via Windows API calls. I believe feeding keystrokes is possible but I think it's frowned on in general because that's the sort of activity viruses and malware would love to do if allowed to do so.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only