convert html string into a html document

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • csgraham74

    #1

    convert html string into a html document

    Hi,

    Ive posted on this previously but had no response. Basically i need to
    build some html using a rich text editor. Then i want to actually
    create an html document from this and save it to my server. Does
    anyone have any examples on how to do this ??

    I dont really understand how to get from HTML string to HTML document.
    I can probably work out how to save this. do i create an html object ??

    Any help appreciated

    Colin Graham

  • Oenone

    #2
    Re: convert html string into a html document

    csgraham74 wrote:
    Ive posted on this previously but had no response. Basically i need to
    build some html using a rich text editor. Then i want to actually
    create an html document from this and save it to my server. Does
    anyone have any examples on how to do this ??
    I'm not entirely clear what you're trying to do here...

    Are you trying to use the rich text box to enter fully formatted data (e.g.,
    different font sizes, bold text, etc.etc) in a "WYSIWYG" style, and then
    convert this to HTML (so that all the appropriate tags get inserted to make
    the HTML when viewed in the browser look like the original rich text)? If
    so, I suspect the reason you didn't get an answer is because this is
    potentially a lot of work.

    I've written code in the past to convert raw .rtf content to HTML, and it
    very quickly gets very complex, much more than anyone would be able to help
    with via the newsgroup. There may be 3rd party components that you could
    use, but I don't have any knowledge of them.

    If you are using the rich text box to get the user to enter the raw HTML (so
    they would enter, "<p>Here is some <strong>text</strong>.</p>", then
    converting this to an HTML file is simply a matter of reading the content
    out using the rich text box's .Text property, and then saving it to a .htm
    file on disk. An HTML file is simply a text file with HTML-formatted text
    within it, and usually a .htm or .html file extension.

    Or am I still missing what you're trying to achieve?

    --

    (O)enone


    Comment

    • Timo

      #3
      Re: convert html string into a html document

      I'm not sure either what csgraham74 is trying to do. If he's
      trying to do a "wysiwyg" editor, then

      might be helpful. That's VB6 code but should be easily ported
      to VB.NET.

      - Timo


      "Oenone" <oenone@nowhere .comwrote in message
      news:eH592R$2GH A.1568@TK2MSFTN GP03.phx.gbl...
      csgraham74 wrote:
      >Ive posted on this previously but had no response. Basically i need to
      >build some html using a rich text editor. Then i want to actually
      >create an html document from this and save it to my server. Does
      >anyone have any examples on how to do this ??
      >
      I'm not entirely clear what you're trying to do here...
      >
      Are you trying to use the rich text box to enter fully formatted data
      (e.g., different font sizes, bold text, etc.etc) in a "WYSIWYG" style, and
      then convert this to HTML (so that all the appropriate tags get inserted
      to make the HTML when viewed in the browser look like the original rich
      text)? If so, I suspect the reason you didn't get an answer is because
      this is potentially a lot of work.
      >
      I've written code in the past to convert raw .rtf content to HTML, and it
      very quickly gets very complex, much more than anyone would be able to
      help with via the newsgroup. There may be 3rd party components that you
      could use, but I don't have any knowledge of them.
      >
      If you are using the rich text box to get the user to enter the raw HTML
      (so they would enter, "<p>Here is some <strong>text</strong>.</p>", then
      converting this to an HTML file is simply a matter of reading the content
      out using the rich text box's .Text property, and then saving it to a .htm
      file on disk. An HTML file is simply a text file with HTML-formatted text
      within it, and usually a .htm or .html file extension.
      >
      Or am I still missing what you're trying to achieve?
      >
      --
      >
      (O)enone
      >

      Comment

      • csgraham74

        #4
        Re: convert html string into a html document

        Thanks guys,

        yeah it is a bit of weird one - i am using a rich text editor and i
        have built the html in memory as a string. The step that i need a
        solution for is the save to a document which has an .htm extension.

        I dont know how do do this - any ideas ???

        CG
        Timo wrote:
        I'm not sure either what csgraham74 is trying to do. If he's
        trying to do a "wysiwyg" editor, then

        might be helpful. That's VB6 code but should be easily ported
        to VB.NET.
        >
        - Timo
        >
        >
        "Oenone" <oenone@nowhere .comwrote in message
        news:eH592R$2GH A.1568@TK2MSFTN GP03.phx.gbl...
        csgraham74 wrote:
        Ive posted on this previously but had no response. Basically i need to
        build some html using a rich text editor. Then i want to actually
        create an html document from this and save it to my server. Does
        anyone have any examples on how to do this ??
        I'm not entirely clear what you're trying to do here...

        Are you trying to use the rich text box to enter fully formatted data
        (e.g., different font sizes, bold text, etc.etc) in a "WYSIWYG" style, and
        then convert this to HTML (so that all the appropriate tags get inserted
        to make the HTML when viewed in the browser look like the original rich
        text)? If so, I suspect the reason you didn't get an answer is because
        this is potentially a lot of work.

        I've written code in the past to convert raw .rtf content to HTML, and it
        very quickly gets very complex, much more than anyone would be able to
        help with via the newsgroup. There may be 3rd party components that you
        could use, but I don't have any knowledge of them.

        If you are using the rich text box to get the user to enter the raw HTML
        (so they would enter, "<p>Here is some <strong>text</strong>.</p>", then
        converting this to an HTML file is simply a matter of reading the content
        out using the rich text box's .Text property, and then saving it to a .htm
        file on disk. An HTML file is simply a text file with HTML-formatted text
        within it, and usually a .htm or .html file extension.

        Or am I still missing what you're trying to achieve?

        --

        (O)enone

        Comment

        • Timo

          #5
          Re: convert html string into a html document

          HTML files are simple text files with htm (or html) extension.
          See http://msdn2.microsoft.com/en-us/library/hxwfzt61.aspx
          How to: Write Text to Files with a StreamWriter in Visual Basic

          - Timo


          "csgraham74 " <csgraham74@gma il.comwrote in message
          news:1158756335 .985035.291610@ h48g2000cwc.goo glegroups.com.. .
          Thanks guys,
          >
          yeah it is a bit of weird one - i am using a rich text editor and i
          have built the html in memory as a string. The step that i need a
          solution for is the save to a document which has an .htm extension.
          >
          I dont know how do do this - any ideas ???
          >
          CG
          Timo wrote:
          >I'm not sure either what csgraham74 is trying to do. If he's
          >trying to do a "wysiwyg" editor, then
          >http://www2.bitstream.net/~bradyh/do...tf2htmlrm.html
          >might be helpful. That's VB6 code but should be easily ported
          >to VB.NET.
          >>
          >- Timo
          >>
          >>
          >"Oenone" <oenone@nowhere .comwrote in message
          >news:eH592R$2G HA.1568@TK2MSFT NGP03.phx.gbl.. .
          csgraham74 wrote:
          >Ive posted on this previously but had no response. Basically i need to
          >build some html using a rich text editor. Then i want to actually
          >create an html document from this and save it to my server. Does
          >anyone have any examples on how to do this ??
          >
          I'm not entirely clear what you're trying to do here...
          >
          Are you trying to use the rich text box to enter fully formatted data
          (e.g., different font sizes, bold text, etc.etc) in a "WYSIWYG" style,
          and
          then convert this to HTML (so that all the appropriate tags get
          inserted
          to make the HTML when viewed in the browser look like the original rich
          text)? If so, I suspect the reason you didn't get an answer is because
          this is potentially a lot of work.
          >
          I've written code in the past to convert raw .rtf content to HTML, and
          it
          very quickly gets very complex, much more than anyone would be able to
          help with via the newsgroup. There may be 3rd party components that you
          could use, but I don't have any knowledge of them.
          >
          If you are using the rich text box to get the user to enter the raw
          HTML
          (so they would enter, "<p>Here is some <strong>text</strong>.</p>",
          then
          converting this to an HTML file is simply a matter of reading the
          content
          out using the rich text box's .Text property, and then saving it to a
          .htm
          file on disk. An HTML file is simply a text file with HTML-formatted
          text
          within it, and usually a .htm or .html file extension.
          >
          Or am I still missing what you're trying to achieve?
          >
          --
          >
          (O)enone
          >
          >

          Comment

          Working...