Hi,
my question is: What is the best way to call MSWord from C++
I never did this before. I always used VB6 and the Word-COM-Library:
C:\Program Files\Microsoft Office\OfficeXX\MSWORD.olb
resp:
"Microsoft Word XX.0 Object Library"
how should I use/call Word from C++ (VS2010) ?
should I use .NET ? (C++CLI)
do you have a good step by step explanation?
regards and many thanks in advance
Oops
P.S. a code example in VB
Option Explicit
Sub Main()
Dim mWord As New Word.Application
mWord.ScreenUpdating = False
Dim mMaxParagraph As Long
Dim aDoc As Word.Document
Dim aFileName As String
aFileName = "C:\mydoc.doc"
Set aDoc = mWord.Documents.Open(aFileName)
mMaxParagraph = mWord.ActiveDocument.Paragraphs.Count
Debug.Print CStr(mMaxParagraph)
aDoc.Close
mWord.Quit
End Sub