HELP! Sending text to a Web Form excluding highlighted text?
Hello,
I am new here! & also newish to programming, but I am a fast learner.
I'm trying to find out the best method for using vb6 to make an application that can speed up my job at work.
What im trying to do is :
When I highlight some text in an editable text box on a webpage form (PHP),
I want to have the option to auto add <b> to the start of the highlighted text and </b> at the end. maybe having a command button called "Bold"
And also add functions such as automatic line breaks, <BR> at the end of every line? Basically much the same as this box im writing the post in but less features.
How would i go about achieving this? whats the best approach?, and are they any tutorials out there?
Cheers I would appreciate any help on this or any hints!
Re: HELP! Sending text to a Web Form excluding highlighted text?
I don't really know what you mean. But if you have a web browser control on your form then you can change the values of text boxes etc.
I have attached a project with an example of how to use the web document.
Re: HELP! Sending text to a Web Form excluding highlighted text?
Hi , Great effort, thanks for trying, Thats exactly what I meant!
Except, unfortunately I tried it on a standard multiline form, modified the name value to suit.
If i make 3 lines of text, and select and highlight the second line, it will only wrap from beginning to end(1st line to 3rd), not before and after the 2nd line.
Re: HELP! Sending text to a Web Form excluding highlighted text?
actually, there could be another way by sending keys to a multi-line textbox, but i cant find out how to exclude the highlighted text, ive been practising with things like this:
Private Sub Command8_Click()
Text1.SetFocus
SendKeys "<b>" & "</b>" '** send a string
End Sub
how do you exclude the highlighted text, so the <b> appears before, and the </b> after?
If i can do this i can simply copy the text from the webpage, paste into the box and then repaste back again when complete, still making my life easier!
Although it would be great to load the text from the specific form name on a webpage into the textbox
Sorry i am new!
Re: HELP! Sending text to a Web Form excluding highlighted text?
Hello,
Is this really a hard thing to do with visual basic (6) or are people just reluctant to help someone new?
All I need is a hint or explanation, for example on how to add the strings <b> & </b> on the ends of selected text, so it looks like this:
<b>SELECTED/HIGHLIGHTED TEXT HERE</b>
Im just hoping to get this to work on a multiline textbox for now, with just the text I currently select/highlight..
Also worth noting the code vanessa shared, may work the first time round, and wont the next time, this only happens if you use windows, with IE7 installed.
This is a bug with IE7 and VB6, you will get errors about IEframe.dll\1 etc..
You can fix this for good by using this reg fix
Code:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\TypeLib\{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}]
[HKEY_CLASSES_ROOT\TypeLib\{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}\1.1]
@="Microsoft Internet Controls"
[HKEY_CLASSES_ROOT\TypeLib\{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}\1.1\0]
[HKEY_CLASSES_ROOT\TypeLib\{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}\1.1\0\win32]
@="C:\\WINDOWS\\system32\\ieframe.dll"
I really appreciate everyones time!
Thank you!
PS any pointers on cursor positions on multiline textboxes etc.. would be good also!
Re: HELP! Sending text to a Web Form excluding highlighted text?
Originally Posted by finker
. . . im sure all you so called experts . . .
Originally Posted by finker
. . . Thanks for nothing . . .
Sorry that we didn't drop everything just to answer your question. Your comments are a great way to get people to help you in the future. Have you ever heard of the term "Burning Bridges behind you"? I for one will be first inline to help you the next time
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
Re: HELP! Sending text to a Web Form excluding highlighted text?
yet you suddenly within minutes of me posting, find time to post a message anyway..
A forum is about helping each other with problems and helping newbies like myself, not ignoring questions becuase you cant be arsed to reply becuase you think "newbie" or "noob" in 13 year old "Leet" speak.
I've so far found this forum to be the most unhelpfull i've ever came across, and im just being honest.
Anyway resolved!
For anyone wanting to know how..
make a command button called boldtag, add a textbox called text1 (default)
Private Sub Boldtag_Click()
Text1.SelText = "<B>" & Text1.SelText & "</B>"
End Sub
Last edited by finker; Sep 14th, 2007 at 03:34 PM.
Re: HELP! Sending text to a Web Form excluding highlighted text?
I don't think it's about being new, at least I hope not. It's more that sometimes the right people are on hand and sometimes they are not. I hope you don't let one bad impression put you off us for life.
Anyway, as I say, JavaScript would be the tool of my choice for this task, not VB; the reason being that JS is designed to interact directly with the elements on the page, whereas doing this using the MSHTML object model is a relatively arduous task. If you're interested in pursuing an alternative method then let me know and I can try and create an example using JS.
Edit: Blech, perhaps I completely misunderstood the problem, judging by the code sample in your last post.
Re: HELP! Sending text to a Web Form excluding highlighted text?
Originally Posted by Vanasha
I don't really know what you mean. But if you have a web browser control on your form then you can change the values of text boxes etc.
I have attached a project with an example of how to use the web document.
thanks for the useful code...
i was wondering if it's possible to open a web page like
So the url get's opened in the default browser (mine is firefox ) and then somehow i would like to be able to interact with the fileds present in that url...and eventually click the submit button...