Solved

Change the file extension from .html to .mht

Posted on 2006-11-14
5
205 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now