0

I want to create a project: an application to automate Microsoft Office Word Documents, that has to modify ready-made templates.

I want you to help with this project, to provide me a starting point.

Which one should I pick among WIN32 C++ or MFC C++? What library should I use? and the last thing, will that library need Microsoft Office to be installed on the machine my applications runs on? I know that my question has more answers, but please help me with this, I want to practice and I need a good start.

Thanks in advance! P.S. I want my application to run on Windows 7 and to generate DOCX files.

Kara
  • 6,115
  • 16
  • 50
  • 57
Victor
  • 13,914
  • 19
  • 78
  • 147

2 Answers2

5

Which one should I pick among WIN32 C++ or MFC C++?

Either one is fine. However, MFC will make your job a lot easier and you can finish faster. You will have to write more code yourself if you use raw win32 api.

What library should I use?

Google Word Automation C++ or Word Automation MFC. With MFC use the ClassWizard generator, see instructions here or for raw winapi see this CodeProject article for starters.

will that library need Microsoft Office to be installed on the machine my applications runs on?

For Word Automation, yes. Otherwise, you would need a C++ library that understands docx files. I don't know of a solution, but I do know docx document is a Zip archive in OpenXML format (reference). You could try uncompressing it and working from there or see libOPC which seems to provide that (but I do not know the specifics and how difficult it would be). I did find Where is the documentation for Office's docx/xlsx/pptx formats if you want to look more into the file format.

(Also, as noted in the comments C# would make your life easier (unless you really want to stick with C++)).

Community
  • 1
  • 1
Jesse Good
  • 50,901
  • 14
  • 124
  • 166
0

If your app will have a substantial GUI then MFC is a good choice. But the ATL library is much better suited to working with COM interfaces (and all of the interface to Office apps uses COM) and has much less overhead than MFC. Search MSDN for "ATL samples".

ScottMcP-MVP
  • 10,337
  • 2
  • 15
  • 15