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. display word file on form

display word file on form

Scheduled Pinned Locked Moved C#
csharpvisual-studiocomhelpquestion
13 Posts 5 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.
  • H hazzem elrefai

    first :thanx so much second :handel it mean: i need to count words, catch user events, merge to file....things like these. do u mean to host my web browser in my form and open my doc file in the web controle?? i'll c what can i get from this thnx another time

    S Offline
    S Offline
    Stephane Rodriguez
    wrote on last edited by
    #4

    Handling a word document the way you want it and showing it at the same time is best done in the context of a Word add-in, where you get both your freedom and the automation handle to play with. I'll definitely would go that route, rather the opposite where you are asking for troubles. Plenty of articles for writing your add-ins everywhere. Troubles since :

    • As of date, winforms don't (directly) support active documents (ole container). Whidbey due in June is supposed to solve this, but I guess this is too late!
    • Internet explorer is a ole site for all sorts of things, including active documents. So if you host IE in your form, it can in turn act like a host for whatever OLE document including Word, Excel, ... But showing it is mostly the thing you can do with it. It's much harder to tunnel commands this way.
    • Although C# does COM interop, it's not very good at doing this, especially when you need both the visible stuff, and the automation stuff. What I mean is that there are a lot of problems when you the stuff to release well from the memory, to behave well when you click, etc.

    Good luck!


    RSS feed

    H 1 Reply Last reply
    0
    • S Stephane Rodriguez

      Handling a word document the way you want it and showing it at the same time is best done in the context of a Word add-in, where you get both your freedom and the automation handle to play with. I'll definitely would go that route, rather the opposite where you are asking for troubles. Plenty of articles for writing your add-ins everywhere. Troubles since :

      • As of date, winforms don't (directly) support active documents (ole container). Whidbey due in June is supposed to solve this, but I guess this is too late!
      • Internet explorer is a ole site for all sorts of things, including active documents. So if you host IE in your form, it can in turn act like a host for whatever OLE document including Word, Excel, ... But showing it is mostly the thing you can do with it. It's much harder to tunnel commands this way.
      • Although C# does COM interop, it's not very good at doing this, especially when you need both the visible stuff, and the automation stuff. What I mean is that there are a lot of problems when you the stuff to release well from the memory, to behave well when you click, etc.

      Good luck!


      RSS feed

      H Offline
      H Offline
      hazzem elrefai
      wrote on last edited by
      #5

      after alot alot alot of searshing i agree with but i have a project and i have to finish it any way, and i'll not give up till i finish it, event if i have to code any needed objects for this, but i do not want to go that way now, i have found com component that display the doc but i can not play with it, ........................!!!!!!!!!!

      V 1 Reply Last reply
      0
      • H hazzem elrefai

        after alot alot alot of searshing i agree with but i have a project and i have to finish it any way, and i'll not give up till i finish it, event if i have to code any needed objects for this, but i do not want to go that way now, i have found com component that display the doc but i can not play with it, ........................!!!!!!!!!!

        V Offline
        V Offline
        Vocjeny
        wrote on last edited by
        #6

        :laugh: Vocjeny

        1 Reply Last reply
        0
        • H hazzem elrefai

          first :thanx so much second :handel it mean: i need to count words, catch user events, merge to file....things like these. do u mean to host my web browser in my form and open my doc file in the web controle?? i'll c what can i get from this thnx another time

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #7

          Stephane's idea is probably the best way to embed a Word document in your application. There is another way, though, if you really want to go to all the work, but you should be very familiar with ActiveX programming interfaces. The WebBrowser control (actually, MSHTML) can host the doc because it is a container. Making your application a valid ActiveX container is very difficult and requires that you implement many interfaces (most of which are not defined in the .NET base class library, so you either have to create an interop assembly or manually define the interfaces with all the right attributes and parameter marshaling). Just to name a view interface, you'll need to read about IOleContainer, IOleDocumentView, IOleWindow, and many more. You can use oleview.exe to examine the interfaces implemented by the Microsoft HTML Document COM object (mshtml.dll) for a list. Not all the interfaces have to be implemented, though.

          -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

          1 Reply Last reply
          0
          • H hazzem elrefai

            and i need to display word docs on my form and handle it. i can do this with excel docs by adding it's component in the toolbar from com components. but there is no com component for word. and i do not know what is the problem exactly!!!! Iam using vs.net 2003 profissional and office 2002(xp) and can not use office2003 thnx in advance

            G Offline
            G Offline
            Guillermo Rivero
            wrote on last edited by
            #8

            I found an activex control built by microsoft people that holds an Office document, and you can use it in your forms. I don't have the url, but have the file. I'll put it on my server and you can download it from there. http://www.juriscomp.com/emp/guille[^] Free your mind...

            1 Reply Last reply
            0
            • H hazzem elrefai

              and i need to display word docs on my form and handle it. i can do this with excel docs by adding it's component in the toolbar from com components. but there is no com component for word. and i do not know what is the problem exactly!!!! Iam using vs.net 2003 profissional and office 2002(xp) and can not use office2003 thnx in advance

              G Offline
              G Offline
              Guillermo Rivero
              wrote on last edited by
              #9

              I found the URL http://support.microsoft.com/support/kb/articles/q311/7/65.asp[^] Free your mind...

              H 2 Replies Last reply
              0
              • G Guillermo Rivero

                I found the URL http://support.microsoft.com/support/kb/articles/q311/7/65.asp[^] Free your mind...

                H Offline
                H Offline
                hazzem elrefai
                wrote on last edited by
                #10

                Thnx so much Guillermo i've downloaded this activex and i'll test it and citact u back thnk in advance u was so helpful

                1 Reply Last reply
                0
                • G Guillermo Rivero

                  I found the URL http://support.microsoft.com/support/kb/articles/q311/7/65.asp[^] Free your mind...

                  H Offline
                  H Offline
                  hazzem elrefai
                  wrote on last edited by
                  #11

                  i tryed the activex and it's exactly what iam looking for. but i have found a web sample writen in vbscript(client side script) and i wanna know if i can deal with this activex by dynamic serverside script, or by another words can play with this control by asp.net coz i do not know much about vb syntax.

                  G 1 Reply Last reply
                  0
                  • H hazzem elrefai

                    i tryed the activex and it's exactly what iam looking for. but i have found a web sample writen in vbscript(client side script) and i wanna know if i can deal with this activex by dynamic serverside script, or by another words can play with this control by asp.net coz i do not know much about vb syntax.

                    G Offline
                    G Offline
                    Guillermo Rivero
                    wrote on last edited by
                    #12

                    What exactly do you want to do ?? I used the ActiveX on a windows form application, but I've never used it on a web page, just saw the example that came with the package. If you give me a little description about what you want to do, may be I can give you a hand. Free your mind...

                    H 1 Reply Last reply
                    0
                    • G Guillermo Rivero

                      What exactly do you want to do ?? I used the ActiveX on a windows form application, but I've never used it on a web page, just saw the example that came with the package. If you give me a little description about what you want to do, may be I can give you a hand. Free your mind...

                      H Offline
                      H Offline
                      hazzem elrefai
                      wrote on last edited by
                      #13

                      never mind Guillermo i desided to use it with windows form but plz allow me to contact u after this. coz i have some problems in this project coz most of my experience in the web field with java(jsp) & asp.net(c#) thnx so much

                      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