Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 05 DEC 2023 10:55:34AM Nick Stevenson wrote:

Hi

Migrating 9.4.4 to 10.2.0.

We use OLE to carry out Word merge and print to printer or use Word SAVEAS to save to pdf.

Been working for years in OI9.4.4

In OI 10 this code gives OLE error -2147352571

wdFormatPDF = 17

oSaveAs = OleCallMethod(oDocHandle2, "SAVEAS2", pdfName, wdFormatPDF)

From other posts I note that OleCallMethod has been tightened up - but how how does that affect this code?

Thanks,

Nick


At 05 DEC 2023 11:05AM Nick Stevenson wrote:

I meant to add that it is the 4th parameter (wdFormatPDF) that is causing the problem. If I leave it out, the save works but of course it isn't in pdf format.


At 05 DEC 2023 11:15AM Donald Bakke wrote:

Hi

Migrating 9.4.4 to 10.2.0.

We use OLE to carry out Word merge and print to printer or use Word SAVEAS to save to pdf.

Been working for years in OI9.4.4

In OI 10 this code gives OLE error -2147352571

wdFormatPDF = 17

oSaveAs = OleCallMethod(oDocHandle2, "SAVEAS2", pdfName, wdFormatPDF)

From other posts I note that OleCallMethod has been tightened up - but how how does that affect this code?

Thanks,

Nick

Based on a quick Google search, it seems this is a Type mismatch error. Does this help?

Don Bakke

SRP Computer Solutions, Inc.


At 05 DEC 2023 11:18AM Nick Stevenson wrote:

Don - I have checked the WDFormatPDF enumeration and it is correct at 17. It has worked in OI9 for years, something in OI10 is failing.


At 05 DEC 2023 12:45PM Carl Pates wrote:

HI Nick,

I've traced the issue to the way in which OI translates numeric values from Basic+ to the OLE variant data structure. As we're a 64-app now we hold integers in a 64-bit format, and when we translate for OLE we set them to a 64-bit format also (VT_I8).

It appears that 64-bit Word doesn't like this and will only accept the 32-bit format (VT_I4). - i.e. it doesn't bother to check that the value that has been passed will fit into a 32-bit format, and so you get a type mismatch.

We'll make a change here going forward to make that check ourselves rather than relying on the target to bother checking (even though it's advertised type is "variant", so it should try these things, but I'm not bitter or anything).

This won't make 10.2.1 (which due for release like, pretty much now) as it will need some testing, but after 10.2.1 we can talk about getting you a patched DLL for testing during your migration.

Regards,

Carl Pates


At 06 DEC 2023 11:22AM Nick Stevenson wrote:

Hi Carl

Thanks for the update. Is there any workaround for this until it is fixed? This will put a hold on our OI10 migration.

Thanks

Nick


At 06 DEC 2023 11:27AM Carl Pates wrote:

Hi Nick,

The workaround is to go to 10.2.1 and then give you a patch for RevEngine.dll until 10.3 is released.

Regards

Carl Pates


At 20 JUN 2024 07:35AM Nick Stevenson wrote:

Further to the threads from December 2023, has this issue been resolved in 10.2.2?

Using more than one parameter (even if passed as a null) in OleCallMethod results in the dreaded 2147352571 error.

oDataSource = OleCallMethod(oMMerge, "OPENDATASOURCE", DataSource) is fine.

oDataSource = OleCallMethod(oMMerge, "OPENDATASOURCE", DataSource,'') fails with 2147352571.


At 20 JUN 2024 08:02AM Carl Pates wrote:

Hi Nick,

Yes it's fixed for v10.2.2

Regards

Carl Pates


At 20 JUN 2024 08:05AM Nick Stevenson wrote:

Excellent!

Thanks,

Nick

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/d325b411e905034aaf4fe4a2cbf2c4a9.txt
  • Last modified: 2024/12/10 16:16
  • by 127.0.0.1