Home Forums C Programming Get Formatted Text From WORD!

Viewing 0 reply threads
  • Author
    • #2013

      Hi everyone,
      I working with WORD by C++. I am stuck in a trouble that I can not know
      how to get the formatted text from word to handle. My code like this:

      I declare a range, I got plain text from WORD correctly,
      But I want formatted text.
      _Document *testDoc;
      LPDISPATCH pdisp;
      pdisp = testDoc->Range(COleVariant( (long)DISP_E_PARAMNOTFOUND,
      VT_ERROR ), COleVariant( (long)DISP_E_PARAMNOTFOUND, VT_ERROR ) );
      Range r;
      TextEffectFormat pFormat;

      //I confuse if this code is correct(It compiled, but not run correctly)
      pFormat = r.GetFormattedText();//return LPDISPATCH
      CString tt = pFormat.GetText(); // program exit when excute this line

      Is this sniplet correct? How to get formatted text and out put?
      Please help me, I need to finish this project as quickly as possible. Thank you so much.

Viewing 0 reply threads
  • The forum ‘C Programming’ is closed to new topics and replies.