Solved

Change the file extension from .html to .mht

Posted on 2006-11-14
5
221 Views
Last Modified: 2010-04-16
hi experts,
  I m developing one small application in vb.net which should work in the following way.
     I do have on textbox & one command button on my form. What i wanted do is, I will type some url's in that textbox with extension .html, Whenever i will press the command button the url's that i have typed, should convert their .html extension to .mht & should get saved in my hard drive ie it should search a pages from the net that i have typed & should save that pages with .mht extension.

Anybody having idea plz help.

it's urgent

thanx
0
Comment
Question by:s_monani
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 5

Expert Comment

by:jalalmegadeth
ID: 17944905
so if i understood your question, u want a script that finds the .html, and replaces it by .mht

it's kind of find and replace

take a look at this page, you may find the answer :
http://www.codeproject.com/useritems/findandriplace_rtb.asp

and here's the function you may need :



Public Class RichTextBoxFR
    Inherits RichTextBox
   
    Public Sub FindAndReplace(ByVal FindText As String, ByVal ReplaceText As String)
    Me.Find(FindText)
            If Not Me.SelectionLength = 0 Then
            Me.SelectedText = ReplaceText
            Else
            MsgBox("The following specified text was not found: " & FindText)
            End If
    End Sub
   
End Class


GL


0
 
LVL 1

Author Comment

by:s_monani
ID: 17946678
thanx for reply sir,
  But it is not exactly i wanted. This code will just replace the specified string to other.
Let u have one example.
  Consider i m opening www.yahoo.com page in browser, So by using my application it should save this page with .mht extension.
 I hope u have got it now
thanx
0
 
LVL 4

Accepted Solution

by:
hclgroup earned 500 total points
ID: 17947739
0
 
LVL 1

Author Comment

by:s_monani
ID: 17962559
Thanx it's working great

Thanx again
0
 
LVL 1

Author Comment

by:s_monani
ID: 17971079
hi hclgroup,
 One problem has arose in that code.  This code saves the home page to the harddisk, means if i will save the file, then it saved in the format of .mht, but when i opened it, it direclty opens the live page of that file, means it do not open it from myh harddisk.  For example, i m saving the the google page file in the google.mht  format in my c drive (c:\google.mht), but when i open it, the address in the address bar is www.google.com instead of c:\google.mht.  I don't want in this format. Is there any other way out.

Plz help.
plz send me the solution at subunotes@yahoo.co.in as soon as possible. It's urgent
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Progress

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question