×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Complex question, are you up to it?

Complex question, are you up to it?

Complex question, are you up to it?

(OP)
Just joined so I could ask this tough question.  I work for a company and we use Zope.  Problem with Zope is no IDE, you have to use a browser to access it.  I'm trying to design a program in VB6 to speed up typing certain things.

Now the problem:

If you select text in a TextArea in the browser (IE, Mozilla, or Netscape) I'm trying to find a way to grab that selected text.  As of right now I'll end up using keybd_event to send information so it gets inserted into that TextArea, and the clipboard (making a person copy the selected text there first) to get the selected text.  If anyone knows a way to grab the selected text from the TextArea and possibly even write to the TextArea at the current cursor position I would really love to know.

I've searched the net and can't find anything online to help me at all.

Thanks in advance to anyone who responds!

RE: Complex question, are you up to it?

You could try using a java servlet to retrieve the page and extract/enter whatever you want.

RE: Complex question, are you up to it?

(OP)
Hi dyerger,

It's an idea, but it wouldn't work because of how Zope works.  Say you have a page index_html, to edit that in Zope you point a browser to the management of that page.  The text in the TextArea where you are typing (adding and changing code) doesn't save the page until you tell it to.  So if you tried to grab the page that way you'd get the code as of the last save.  I need something that can get into the browser, into that TextArea and work in there.

Thanks for trying though.

RE: Complex question, are you up to it?

Have you tried using Window API's, all objects displayed are windows (your textbox is a window, inside your browser window), and each have their own 'handle'.  Using this handle you can then access the text box in question.



RE: Complex question, are you up to it?

One of the scripts copies into textarea and the other copies
from textarea (HTML page). Also there are a lot of scripts on the net regarding TEXTAREA.

***************************************************
The following script allows you to select text on a web page and then copy it into a text box.

<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function copyit(theField) {
    var selectedText = document.selection;
    if (selectedText.type == 'Text') {
        var newRange = selectedText.createRange();
        theField.focus();
        theField.value = newRange.text;
    } else {
        alert('select a text in the page and then press this button');
    }
}
</script>
</HEAD>
<BODY>
<form name="it">
<div align="center">
<input onclick="copyit(this.form.select1)" type="button" value="Press to copy the highlighted text" name="btnCopy">
<p>
<textarea name="select1" rows="4" cols="45"></textarea>
</div>
</form>
</body>

************************************ OR
//Grab form field text
<HEAD>
<SCRIPT LANGUAGE='JavaScript'>
<!--
function aceGrabText(fieldName){
fieldName.focus();
fieldName.select();
}
-->
</SCRIPT>

</HEAD>
<BODY>
<A href="javascript:aceGrabText(document.form1.field1)">Click to Select</A>

<FORM name="form1">
<textarea rows="12" cols="62" name="field1">Text goes here.</textarea>
</FORM>

</BODY

RE: Complex question, are you up to it?

I am not sure what you are trying to do with VB6  in Browser (IE,...) environment. Are you trying to have rich TEXTBOX in your page? If so, it is done with DHTML and JS.
But the folowing site may help also.

IE Editor for Zope
http://vsbabu.org/webdev/zopedev/ieeditor.html

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources