?
Solved

Change the file extension from .html to .mht

Posted on 2006-11-14
5
Medium Priority
?
229 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 2000 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
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…
Introduction to Processes
Suggested Courses

752 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