word Doc SaveAs2 method crashing after installing MSOffice2013

0

I'm using the saveAs2 method to save a word document to XML format document. My application very well executed till i had the MS office 2010 in my system. But once i upgraded my system to office365(MSoffice2013 version) , application started throwing exception while performing saveAs2.

Any clues to resolve this issue, please post.

Code snippet :

int CWordDoc::SaveAs(CString filename, short file_format)
{
   AFX_MANAGE_STATE(AfxGetStaticModuleState());

   CString new_filename;

   if(filename.GetLength() == 0)
   {
      new_filename = filename;
   }

   // COleVariant var_filename((_bstr_t) filename);
   COleVariant var_filename(filename);

    COleVariant var_fileformat(file_format);

    short file_formatCompat = 14;
   COleVariant var_fileformatCompat(file_formatCompat);

#if MSWORD8 
   wordDoc.SaveAs(&var_bstr,
                    &vtMissing,
                        &vtMissing,
                        &vtMissing,
                        &vtMissing,
                        &vtMissing,
                        &vtMissing,
                        &vtMissing,
                        &vtMissing,
                        &vtMissing,
                        &vtMissing); 
#elif MSWORD11 
   wordDoc.SaveAs2(&var_filename,
                    &var_fileformat,
                        &vtMissing,
                        &vtMissing,
                        &vtMissing,
                        &vtMissing,
                        &vtMissing,
                        &vtMissing,
                        &vtMissing,
                        &vtMissing,
                        &vtMissing,
                        &vtMissing,
                        &vtMissing,
                        &vtMissing,
                        &vtMissing,
                        &vtMissing,
                        &var_fileformatCompat); 
#else
#pragma message("Unknown MSWord version (must define MSWORD8 or MSWORD11)")
#endif

   return 1;
}

Getting the below exception :

unhandled exception in .exe (KERNELBASE.DLL) 0XE06D7363:Microsoft C++ exception"

xml
visual-c++
dll
ms-word
com
asked on Stack Overflow May 30, 2016 by user3345799 • edited Jun 9, 2016 by user3345799

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0