How to create a new ParagraphFormat object using MFC

M

mjlaali

I am developing a word automation application using MFC. I need to create a
new ParagraphFormat object and pass it to SetParagraphFormat method of a
Range object. The problem is that I don't know how to obtain an appropriate
IDispatch pointer and attach it to my newly created _ParagraphFormat object.
As a result the m_lpDispatch property of my object is NULL and when I pass it
to the method I will receive an exception with the code of 0x80070057 which
means that the argument is invalid.
Is there anyone who could help me with this matter?
 
Top