MS Word Automation by using VC++
-
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.
-
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.
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 [^]
-
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.
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
-
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
-
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 [^]