"HTML-Editor" aus Richtextbox

  • VB.NET

Es gibt 23 Antworten in diesem Thema. Der letzte Beitrag () ist von Marcus Gräfe.

    "HTML-Editor" aus Richtextbox

    Hallo,
    wie konvertiere ich eine RTB (also die farben und Formatierungen) in einen HTML String ? Habe schon gegooglet und hier die SuFu genutzt, aber was vernünfitgies hab ich nicht gefunden ...


    lg
    Marvin
    damit kann ich mal iwie garnix anfangen.. und das Projekt downloaden kann ich auch nicht; weil ich dort nicht angemeldet bin... Und mich gerade auch nicht anmelden kann, weil ich mit nem sufstick ohne flatrate online bin...

    gibts noch was?


    lg
    Nur für den Text "Hallo mein Name ist Marv1n"


    gibt mir das Programm diesen QC aus:

    HTML-Quellcode

    1. <html xmlns:o="urn:schemas-microsoft-com:office:office"
    2. xmlns:w="urn:schemas-microsoft-com:office:word"
    3. xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
    4. xmlns="http://www.w3.org/TR/REC-html40">
    5. <head>
    6. <meta http-equiv=Content-Type content="text/html; charset=utf-8">
    7. <meta name=ProgId content=Word.Document>
    8. <meta name=Generator content="Microsoft Word 12">
    9. <meta name=Originator content="Microsoft Word 12">
    10. <link rel=File-List
    11. href="file:///C:\Users\Marvin\AppData\Local\Temp\msohtmlclip1\01\clip_filelist.xml">
    12. <link rel=themeData
    13. href="file:///C:\Users\Marvin\AppData\Local\Temp\msohtmlclip1\01\clip_themedata.thmx">
    14. <link rel=colorSchemeMapping
    15. href="file:///C:\Users\Marvin\AppData\Local\Temp\msohtmlclip1\01\clip_colorschememapping.xml">
    16. <!--[if gte mso 9]><xml>
    17. <w:WordDocument>
    18. <w:View>Normal</w:View>
    19. <w:Zoom>0</w:Zoom>
    20. <w:TrackMoves/>
    21. <w:TrackFormatting/>
    22. <w:HyphenationZone>21</w:HyphenationZone>
    23. <w:PunctuationKerning/>
    24. <w:ValidateAgainstSchemas/>
    25. <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
    26. <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
    27. <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
    28. <w:DoNotPromoteQF/>
    29. <w:LidThemeOther>DE</w:LidThemeOther>
    30. <w:LidThemeAsian>X-NONE</w:LidThemeAsian>
    31. <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
    32. <w:Compatibility>
    33. <w:BreakWrappedTables/>
    34. <w:SnapToGridInCell/>
    35. <w:WrapTextWithPunct/>
    36. <w:UseAsianBreakRules/>
    37. <w:DontGrowAutofit/>
    38. #### Teil entfernt #####
    39. <m:dispDef/>
    40. <m:lMargin m:val="0"/>
    41. <m:rMargin m:val="0"/>
    42. <m:defJc m:val="centerGroup"/>
    43. <m:wrapIndent m:val="1440"/>
    44. <m:intLim m:val="subSup"/>
    45. <m:naryLim m:val="undOvr"/>
    46. </m:mathPr></w:WordDocument>
    47. </xml><![endif]--><!--[if gte mso 9]><xml>
    48. <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
    49. DefSemiHidden="true" DefQFormat="false" DefPriority="99"
    50. LatentStyleCount="267">
    51. <w:LsdException Locked="false" Priority="0" SemiHidden="false"
    52. UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
    53. <w:LsdException Locked="false" Priority="9" SemiHidden="false"
    54. UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
    55. <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
    56. <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
    57. <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
    58. <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
    59. <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
    60. <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
    61. <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
    62. <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
    63. <w:LsdException Locked="false" Priority="39" Name="toc 1"/>
    64. <w:LsdException Locked="false" Priority="39" Name="toc 2"/>
    65. <w:LsdException Locked="false" Priority="39" Name="toc 3"/>
    66. <w:LsdException Locked="false" Priority="39" Name="toc 4"/>
    67. <w:LsdException Locked="false" Priority="39" Name="toc 5"/>
    68. <w:LsdException Locked="false" Priority="39" Name="toc 6"/>
    69. <w:LsdException Locked="false" Priority="39" Name="toc 7"/>
    70. <w:LsdException Locked="false" Priority="39" Name="toc 8"/>
    71. <w:LsdException Locked="false" Priority="39" Name="toc 9"/>
    72. <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
    73. <w:LsdException Locked="false" Priority="10" SemiHidden="false"
    74. UnhideWhenUsed="false" QFormat="true" Name="Title"/>
    75. <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
    76. <w:LsdException Locked="false" Priority="11" SemiHidden="false"
    77. UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
    78. #### Teil entfernt #####
    79. <w:LsdException Locked="false" Priority="62" SemiHidden="false"
    80. UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
    81. <w:LsdException Locked="false" Priority="63" SemiHidden="false"
    82. UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
    83. <w:LsdException Locked="false" Priority="64" SemiHidden="false"
    84. UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
    85. <w:LsdException Locked="false" Priority="65" SemiHidden="false"
    86. UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
    87. <w:LsdException Locked="false" Priority="66" SemiHidden="false"
    88. UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
    89. <w:LsdException Locked="false" Priority="67" SemiHidden="false"
    90. UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
    91. <w:LsdException Locked="false" Priority="68" SemiHidden="false"
    92. UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
    93. <w:LsdException Locked="false" Priority="69" SemiHidden="false"
    94. UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
    95. <w:LsdException Locked="false" Priority="70" SemiHidden="false"
    96. UnhideWhenUsed="false" Name="Dark List Accent 5"/>
    97. <w:LsdException Locked="false" Priority="71" SemiHidden="false"
    98. UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
    99. <w:LsdException Locked="false" Priority="72" SemiHidden="false"
    100. UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
    101. <w:LsdException Locked="false" Priority="73" SemiHidden="false"
    102. UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
    103. <w:LsdException Locked="false" Priority="60" SemiHidden="false"
    104. UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
    105. <w:LsdException Locked="false" Priority="61" SemiHidden="false"
    106. UnhideWhenUsed="false" Name="Light List Accent 6"/>
    107. <w:LsdException Locked="false" Priority="62" SemiHidden="false"
    108. #### Teil entfernt #####
    109. <w:LsdException Locked="false" Priority="71" SemiHidden="false"
    110. UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
    111. <w:LsdException Locked="false" Priority="72" SemiHidden="false"
    112. UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
    113. <w:LsdException Locked="false" Priority="73" SemiHidden="false"
    114. UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
    115. <w:LsdException Locked="false" Priority="19" SemiHidden="false"
    116. UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
    117. <w:LsdException Locked="false" Priority="21" SemiHidden="false"
    118. UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
    119. <w:LsdException Locked="false" Priority="31" SemiHidden="false"
    120. UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
    121. <w:LsdException Locked="false" Priority="32" SemiHidden="false"
    122. UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
    123. <w:LsdException Locked="false" Priority="33" SemiHidden="false"
    124. UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
    125. <w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
    126. <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
    127. </w:LatentStyles>
    128. </xml><![endif]-->
    129. <style>
    130. <!--
    131. /* Font Definitions */
    132. @font-face
    133. {font-family:"Cambria Math";
    134. panose-1:2 4 5 3 5 4 6 3 2 4;
    135. mso-font-charset:1;
    136. mso-generic-font-family:roman;
    137. mso-font-format:other;
    138. mso-font-pitch:variable;
    139. mso-font-signature:0 0 0 0 0 0;}
    140. @font-face
    141. {font-family:Calibri;
    142. panose-1:2 15 5 2 2 2 4 3 2 4;
    143. mso-font-charset:0;
    144. mso-generic-font-family:swiss;
    145. mso-font-pitch:variable;
    146. mso-font-signature:-520092929 1073786111 9 0 415 0;}
    147. @font-face
    148. {font-family:"Microsoft Sans Serif";
    149. #### Teil entfernt #####
    150. margin-left:0cm;
    151. line-height:115%;
    152. mso-pagination:widow-orphan;
    153. font-size:11.0pt;
    154. font-family:"Calibri","sans-serif";
    155. mso-ascii-font-family:Calibri;
    156. mso-ascii-theme-font:minor-latin;
    157. mso-fareast-font-family:Calibri;
    158. mso-fareast-theme-font:minor-latin;
    159. mso-hansi-font-family:Calibri;
    160. mso-hansi-theme-font:minor-latin;
    161. mso-bidi-font-family:"Times New Roman";
    162. mso-bidi-theme-font:minor-bidi;
    163. mso-fareast-language:EN-US;}
    164. .MsoChpDefault
    165. {mso-style-type:export-only;
    166. mso-default-props:yes;
    167. mso-ascii-font-family:Calibri;
    168. mso-ascii-theme-font:minor-latin;
    169. mso-fareast-font-family:Calibri;
    170. mso-fareast-theme-font:minor-latin;
    171. mso-hansi-font-family:Calibri;
    172. mso-hansi-theme-font:minor-latin;
    173. mso-bidi-font-family:"Times New Roman";
    174. mso-bidi-theme-font:minor-bidi;
    175. mso-fareast-language:EN-US;}
    176. .MsoPapDefault
    177. {mso-style-type:export-only;
    178. margin-bottom:10.0pt;
    179. line-height:115%;}
    180. @page Section1
    181. {size:612.0pt 792.0pt;
    182. margin:70.85pt 70.85pt 2.0cm 70.85pt;
    183. mso-header-margin:36.0pt;
    184. mso-footer-margin:36.0pt;
    185. mso-paper-source:0;}
    186. div.Section1
    187. #### Teil entfernt #####
    188. mso-hansi-font-family:Calibri;
    189. mso-hansi-theme-font:minor-latin;
    190. mso-bidi-font-family:"Times New Roman";
    191. mso-bidi-theme-font:minor-bidi;}
    192. </style>
    193. <![endif]-->
    194. </head>
    195. <body lang=DE style='tab-interval:35.4pt'>
    196. <!--StartFragment-->
    197. <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
    198. normal;mso-layout-grid-align:none;text-autospace:none'><span style='font-size:
    199. 8.5pt;font-family:"Microsoft Sans Serif","sans-serif"'>Hallo </span><b><i><span
    200. style='font-size:10.0pt;font-family:"Microsoft Sans Serif","sans-serif"'>mein</span></i></b><span
    201. style='font-size:8.5pt;font-family:"Microsoft Sans Serif","sans-serif"'> Name
    202. ist </span><span style='font-size:16.0pt;font-family:"Microsoft Sans Serif","sans-serif"'>Marv1n</span><span
    203. style='font-size:8.5pt;font-family:"Microsoft Sans Serif","sans-serif"'><o:p></o:p></span></p>
    204. <p class=MsoNormal><o:p>&nbsp;</o:p></p>
    205. <!--EndFragment-->
    206. </body>
    207. </html>
    208. ùOw


    Das geht ja nun nicht...

    Das hier würde dafür reichen:

    HTML-Quellcode

    1. <p>Hallo <i><b>mein</b></i>Name ist <span front-size="14">Marv1n</span></p>


    Habe ein paar Zeilen aus dem langen HTML Code entfernt, da man nur einen Post mit 15 000 Zeichen posten kann ;)

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „marv1n.de“ ()

    Stimmt schon, aber ich muss das ja noch "übersetzen" bei mir sieht der RTF Code so aus:

    Quellcode

    1. {\rtf1\ansi\ansicpg1252\deff0\deflang1031{\fonttbl{\f0\fswiss\fcharset0 Arial;}}
    2. {\colortbl ;\red255\green0\blue0;}
    3. {\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\f0\fs20 Hallo, \i mein\i0 \cf1 Name\cf0 ist \b Marv1n\par
    4. }


    Wie mach ich darauf jetzt vernünftiges HTML ?


    lg
    Hör mal..
    Ich habe dir bereits einige Links zu Seiten gepostet, wo man fertige Libs dazu findet MIT BEISPIELEN.
    Wenn du zu faul bist, dir das anzuschauen, bzw. durchzulesen wird dir hier niemand helfen.
    Wenn du die Grundlagen nicht beherrschst und ein solches Programm schreiben willst, kann das nicht gut gehen. Deshalb solltest du dir die Grundlagen mit Hilfe eines Buches beibringen: openbook.galileocomputing.de/einstieg_vb_2008/.

    Das allerdreisteste ist ja immernoch das Fordern nach C&P (und in deinem Fall sogar mehrere Male)..
    Wie gesagt.. Geh ins Marktplatz Forum, biete etwas für den Code und hoffe, dass jemand drauf einsteigt.
    Das Forum ist da um zu helfen und Hilfe hast du in den ersten Beiträgen ja zur Genüge erhalten.
    Ich plädiere auf die Schliessung dieses Threads.


    Gruss
    Pascal