Current location: Hot Scripts Forums » Programming Languages » Visual Basic » Change the Title of an HTML page


Change the Title of an HTML page

Reply
  #1 (permalink)  
Old 04-28-04, 06:48 PM
OMID SOFT OMID SOFT is offline
Newbie Coder
 
Join Date: Apr 2004
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Change the Title of an HTML page

We are using the "DHTML Edit Control for IE5" as a component.
Now I'm going to change the Title of loaded HTML document in the Editor.
The following code should be correct :
MainForm.Editor.DocumentTitle = "New Title for HTML Page"
But I get this error :
"Wrong number of arguments or invalid property assignment."
Please note that, Title is surrounded by the :
<TITLE> & </TITLE>
Thank you.
Omid Soroori of OMID SOFT.
Reply With Quote
  #2 (permalink)  
Old 05-09-04, 05:04 AM
OMID SOFT OMID SOFT is offline
Newbie Coder
 
Join Date: Apr 2004
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Answer

I didn't receive any answer within a week.
OK, here is the answer :
-
'Replace Title
If txtTitle.Text <> MainForm.Editor.DocumentTitle Then
PI = InStr(LCase(MainForm.Editor.DocumentHTML), "<title>")
PJ = InStr(LCase(MainForm.Editor.DocumentHTML), "</title>")
PH = Mid(MainForm.Editor.DocumentHTML, PI, PJ - PI + 8)
PM = "<title>" + txtTitle.Text + "</title>"
MainForm.Editor.DocumentHTML = Replace(MainForm.Editor.DocumentHTML, PH, PM)
End If
-
Have a nice day !
Thank you.
Omid Soroori of OMID SOFT.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Classified Ads skipper23 Perl 3 11-22-05 02:22 AM
html page or database table to send by email rpain ASP 5 04-05-04 09:04 AM
php on a html page Bonzo PHP 9 02-06-04 10:40 PM
Classified Ads skipper23 Perl 2 12-30-03 03:43 AM
echo foriegn html in static page fergusom Everything Java 4 11-10-03 02:35 AM


All times are GMT -5. The time now is 01:20 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.