N
NickP
Hi there,
I am calling ExportAsFixedFormat on Word when the PDF export add-in is
*not* installed and it just kills Word,
---
VARIANT pVarOutputFileName; pVarOutputFileName.vt = VT_BSTR;
pVarOutputFileName.bstrVal =
cDPPPrinter->getOutputFileName().AllocSysString();
VARIANT_BOOL pVarOpenAfterExit = FALSE;
VARIANT_BOOL pVarIncludeDocProps = FALSE;
VARIANT_BOOL pVarDocStructureTags = FALSE;
VARIANT_BOOL pVarBitmapMissingFonts = TRUE;
VARIANT_BOOL pVarUseISO = FALSE;
pBlnUsedInternalPDFOutput =
(S_OK==pDPrDocument->ExportAsFixedFormat(pVarOutputFileName.bstrVal,
Word::wdExportFormatPDF, pVarOpenAfterExit,
Word::wdExportOptimizeForOnScreen, Word::wdExportAllDocument, 1, pLngCount,
Word::wdExportDocumentContent, pVarIncludeDocProps, FALSE,
Word::wdExportCreateWordBookmarks, pVarDocStructureTags,
pVarBitmapMissingFonts, pVarUseISO));
---
If I wrap this in a Try Catch block, it still crashes. Basically Word
dies instantly and terminates.
So first question is, this shouldn't be happening right? I know the
parameters I am passing appear to be valid, and secondly, why doesn't my Try
Catch block actually catch anything?
If I install the Add-In, the call works perfectly, and returns S_OK.
But as I have fallback code incase it is missing, I would rather the crash
didn't occur in the first place.
Any ideas?
Thanks in advance.
Nick.
I am calling ExportAsFixedFormat on Word when the PDF export add-in is
*not* installed and it just kills Word,
---
VARIANT pVarOutputFileName; pVarOutputFileName.vt = VT_BSTR;
pVarOutputFileName.bstrVal =
cDPPPrinter->getOutputFileName().AllocSysString();
VARIANT_BOOL pVarOpenAfterExit = FALSE;
VARIANT_BOOL pVarIncludeDocProps = FALSE;
VARIANT_BOOL pVarDocStructureTags = FALSE;
VARIANT_BOOL pVarBitmapMissingFonts = TRUE;
VARIANT_BOOL pVarUseISO = FALSE;
pBlnUsedInternalPDFOutput =
(S_OK==pDPrDocument->ExportAsFixedFormat(pVarOutputFileName.bstrVal,
Word::wdExportFormatPDF, pVarOpenAfterExit,
Word::wdExportOptimizeForOnScreen, Word::wdExportAllDocument, 1, pLngCount,
Word::wdExportDocumentContent, pVarIncludeDocProps, FALSE,
Word::wdExportCreateWordBookmarks, pVarDocStructureTags,
pVarBitmapMissingFonts, pVarUseISO));
---
If I wrap this in a Try Catch block, it still crashes. Basically Word
dies instantly and terminates.
So first question is, this shouldn't be happening right? I know the
parameters I am passing appear to be valid, and secondly, why doesn't my Try
Catch block actually catch anything?
If I install the Add-In, the call works perfectly, and returns S_OK.
But as I have fallback code incase it is missing, I would rather the crash
didn't occur in the first place.
Any ideas?
Thanks in advance.
Nick.