Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Write to Ms word document ???

Write to Ms word document ???

Scheduled Pinned Locked Moved C#
questionhtml
9 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TALHAKOSEN
    wrote on last edited by
    #1

    Hi all, ı wanna learn that how can i write as html on a word document. When i send the string with .typetext(); it writes it as a string. How can i do that ?? thx...

    thanks for everything i have...

    L R P 3 Replies Last reply
    0
    • T TALHAKOSEN

      Hi all, ı wanna learn that how can i write as html on a word document. When i send the string with .typetext(); it writes it as a string. How can i do that ?? thx...

      thanks for everything i have...

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      TALHAKOSEN wrote:

      ı wanna learn  How can i do that ??

      Less typing, more reading. Let us know if that helps.

      led mike

      1 Reply Last reply
      0
      • T TALHAKOSEN

        Hi all, ı wanna learn that how can i write as html on a word document. When i send the string with .typetext(); it writes it as a string. How can i do that ?? thx...

        thanks for everything i have...

        R Offline
        R Offline
        realJSOP
        wrote on last edited by
        #3

        In order to write *anything* on a word document, you have to make sure you lay it on a flat surface, and smooth it out completely (wrinkles in the document tend to distort newly added text). Then - and only then - can you write on the document. After you're done writing on the document, make sure you spray some sort of fixative over the text so it doesn't run when you spill fluids on the document.

        "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
        -----
        "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

        P 1 Reply Last reply
        0
        • R realJSOP

          In order to write *anything* on a word document, you have to make sure you lay it on a flat surface, and smooth it out completely (wrinkles in the document tend to distort newly added text). Then - and only then - can you write on the document. After you're done writing on the document, make sure you spray some sort of fixative over the text so it doesn't run when you spill fluids on the document.

          "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
          -----
          "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          Alternatively, he can always use some form of whiteout on the screen whenever he makes a mistake.

          Deja View - the feeling that you've seen this post before.

          My blog | My articles | MoXAML PowerToys

          P 1 Reply Last reply
          0
          • P Pete OHanlon

            Alternatively, he can always use some form of whiteout on the screen whenever he makes a mistake.

            Deja View - the feeling that you've seen this post before.

            My blog | My articles | MoXAML PowerToys

            P Offline
            P Offline
            Paul Conrad
            wrote on last edited by
            #5

            Pete O'Hanlon wrote:

            use some form of whiteout on the screen whenever he makes a mistake

            Ah, yes, that's always the classic solution :laugh:

            "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

            1 Reply Last reply
            0
            • T TALHAKOSEN

              Hi all, ı wanna learn that how can i write as html on a word document. When i send the string with .typetext(); it writes it as a string. How can i do that ?? thx...

              thanks for everything i have...

              P Offline
              P Offline
              Priya Prk
              wrote on last edited by
              #6

              Hi Talhakosen, Did you read this artikel? : http://www.codeproject.com/KB/aspnet/wordapplication.aspx[^]

              T 1 Reply Last reply
              0
              • P Priya Prk

                Hi Talhakosen, Did you read this artikel? : http://www.codeproject.com/KB/aspnet/wordapplication.aspx[^]

                T Offline
                T Offline
                TALHAKOSEN
                wrote on last edited by
                #7

                yes i have already seen that article but i didnt type my text as html on word document. I found this object pasteType = Word.WdPasteDataType.wdPasteHTML; range.PasteSpecial(ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref pasteType ,ref oMissing, ref oMissing); but it gives me an error says {"The specified data type is unavailable."}

                thanks for everything i have...

                T 1 Reply Last reply
                0
                • T TALHAKOSEN

                  yes i have already seen that article but i didnt type my text as html on word document. I found this object pasteType = Word.WdPasteDataType.wdPasteHTML; range.PasteSpecial(ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref pasteType ,ref oMissing, ref oMissing); but it gives me an error says {"The specified data type is unavailable."}

                  thanks for everything i have...

                  T Offline
                  T Offline
                  TALHAKOSEN
                  wrote on last edited by
                  #8

                  I found the solution, maybe somebody need it... to write as html on c# first take clipboard as html then use stringbuilder Object m = System.Reflection.Missing.Value; DataObject clipDO = new DataObject(); clipDO.SetData(DataFormats.Html, HtmlClipboardData(strHTML)); Clipboard.SetDataObject(clipDO, true); // Save to clipbaord object typeHtml = (object)Word.WdPasteDataType.wdPasteHTML; s.PasteSpecial(ref m, ref m, ref m, ref m, ref typeHtml, ref m, ref m); http://www.codeproject.com/script/Membership/Profiles.aspx?mid=252028 knowledge is valuable when it is shared !!!) and nobody has a right to make fun with anyone!! thx all

                  thanks for everything i have...

                  N 1 Reply Last reply
                  0
                  • T TALHAKOSEN

                    I found the solution, maybe somebody need it... to write as html on c# first take clipboard as html then use stringbuilder Object m = System.Reflection.Missing.Value; DataObject clipDO = new DataObject(); clipDO.SetData(DataFormats.Html, HtmlClipboardData(strHTML)); Clipboard.SetDataObject(clipDO, true); // Save to clipbaord object typeHtml = (object)Word.WdPasteDataType.wdPasteHTML; s.PasteSpecial(ref m, ref m, ref m, ref m, ref typeHtml, ref m, ref m); http://www.codeproject.com/script/Membership/Profiles.aspx?mid=252028 knowledge is valuable when it is shared !!!) and nobody has a right to make fun with anyone!! thx all

                    thanks for everything i have...

                    N Offline
                    N Offline
                    nadinechemali
                    wrote on last edited by
                    #9

                    Hi TALHAKOSEN, I know it's been 2 years on this stream, But is there any chance that you can tell me what's HtmlClipboardData(strHTML)? Thanks for sharing your knowledge. N

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups