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 / C++ / MFC
  4. MS Word Automation by using VC++

MS Word Automation by using VC++

Scheduled Pinned Locked Moved C / C++ / MFC
c++wpftestingtoolshelp
5 Posts 3 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.
  • J Offline
    J Offline
    Jijo Raj
    wrote on last edited by
    #1

    Dear All, We need to generate a Word Document by using MFC. I know the method is Automation and I searched MSDN and Created and saved a simple document with one sentence in it. But the prblem is that we need to create a document with - Table of Contents - Different paragraph style and headings. - Tables with differnt styles. - Border to the page, - Header and Footer. - Differnt color and fonts for different paragraphs. - Insert Picture to Some places. in brief, need to do almost everything by code. I searched a lot in internet to find such tutorials. But cant find. almost all are for VB. But i need VC++ code. Please help me. Regards, Jijo. ________________________________ Yesterday is history, Tomorrow is a mystery, But today is a present.

    M J 2 Replies Last reply
    0
    • J Jijo Raj

      Dear All, We need to generate a Word Document by using MFC. I know the method is Automation and I searched MSDN and Created and saved a simple document with one sentence in it. But the prblem is that we need to create a document with - Table of Contents - Different paragraph style and headings. - Tables with differnt styles. - Border to the page, - Header and Footer. - Differnt color and fonts for different paragraphs. - Insert Picture to Some places. in brief, need to do almost everything by code. I searched a lot in internet to find such tutorials. But cant find. almost all are for VB. But i need VC++ code. Please help me. Regards, Jijo. ________________________________ Yesterday is history, Tomorrow is a mystery, But today is a present.

      M Offline
      M Offline
      Michael P Butler
      wrote on last edited by
      #2

      Converting VB samples to VC++ is easy once you've got your head around the Word object model. There are some good examples here[^], which go beyond a simple document. The mail-merge one is pretty good. I've found the best way to learn the Word Object model is to use the Word Macro recorder to generate VBA code for the operation and then convert that to C++. It's fairly easy if you use #import to generate the C++ wrappers for the object model. Michael CP Blog [^]

      J 1 Reply Last reply
      0
      • J Jijo Raj

        Dear All, We need to generate a Word Document by using MFC. I know the method is Automation and I searched MSDN and Created and saved a simple document with one sentence in it. But the prblem is that we need to create a document with - Table of Contents - Different paragraph style and headings. - Tables with differnt styles. - Border to the page, - Header and Footer. - Differnt color and fonts for different paragraphs. - Insert Picture to Some places. in brief, need to do almost everything by code. I searched a lot in internet to find such tutorials. But cant find. almost all are for VB. But i need VC++ code. Please help me. Regards, Jijo. ________________________________ Yesterday is history, Tomorrow is a mystery, But today is a present.

        J Offline
        J Offline
        Jaime Stuardo
        wrote on last edited by
        #3

        Just load MS Word..... menu Tools/Macro and Record New macro..... do the operation you want to know the code, stop recording, go to Visual Basic Editor and see the code. You can get help for the objects and their methods too. You can do everything by code. Jaime

        J 1 Reply Last reply
        0
        • J Jaime Stuardo

          Just load MS Word..... menu Tools/Macro and Record New macro..... do the operation you want to know the code, stop recording, go to Visual Basic Editor and see the code. You can get help for the objects and their methods too. You can do everything by code. Jaime

          J Offline
          J Offline
          Jijo Raj
          wrote on last edited by
          #4

          Dear Jaime, Thank you very much for your reply. Its very much helpful and easy. Regards, Jijo. ;) ________________________________ Yesterday is history, Tomorrow is a mystery, But today is a present.

          1 Reply Last reply
          0
          • M Michael P Butler

            Converting VB samples to VC++ is easy once you've got your head around the Word object model. There are some good examples here[^], which go beyond a simple document. The mail-merge one is pretty good. I've found the best way to learn the Word Object model is to use the Word Macro recorder to generate VBA code for the operation and then convert that to C++. It's fairly easy if you use #import to generate the C++ wrappers for the object model. Michael CP Blog [^]

            J Offline
            J Offline
            Jijo Raj
            wrote on last edited by
            #5

            Dear Michael, Thank you very much for your advice. Its very much helpful. Regards, Jijo. ;) ________________________________ Yesterday is history, Tomorrow is a mystery, But today is a present.

            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