Hello everyone,
I’m getting the following errors when trying to invoke Word 2010 to convert the file to PDF via a FreePDF printer
This works fine on one client but not another which makes me think its an environmental issue …
E_WT0029 Error at line 5274 of eitreporter_uc.
E_WT006D The invocation of an external object method failed.
The method 'printout' for source 'Microsoft Word' returned an error code
of 80020009 and the error message:
'This method or property is not available because a document window is
not active.'
E_WT0029 Error at line 5275 of eitreporter_uc.
E_WT006D The invocation of an external object method failed.
The method 'printout' for source 'Microsoft Word' returned an error code
of 80020009 and the error message:
'This method or property is not available because a document window is
not active.'
E_WT0029 Error at line 5276 of eitreporter_uc.
E_WT0028 Returning from eitreporter_uc.doc2pdf() due to error.
E_WT0030 Cannot find attribute 'activeprinter' for a variable reference.
The attribute 'activeprinter' was used in a variable reference, but this
attribute is not defined for the type of the variable to which the
attribute is being applied. Recompile the code and check the spelling of
the attribute name.
E_WT006D The invocation of an external object method failed.
The method 'activeprinter' for source 'Microsoft Word' returned an error
code of 80020009 and the error message:
'Command failed'
eitReporter_uc.CreatePDFOutput: PDF could not be created or loaded.
E_WT0029 Error at line 5274 of eitreporter_uc.
METHOD Doc2Pdf
(
XMLDocument = VARCHAR(256) NOT NULL,
PDFDocument = VARCHAR(256) NOT NULL
) =
DECLARE
WordApp# = eitMSWord!Application; // Microsoft Word Object Library
lv_psfile = VARCHAR(256) NOT NULL;
lv_old_printer = VARCHAR(256) NOT NULL;
FreePDF = VARCHAR(256) NOT NULL;
lv_system = VARCHAR(2000) NOT NULL;
ENDDECLARE
{
// This functions prints a Word document on the “FreePDF” printer to postscript
// and converts it to PDF using FreePDF.exe
lv_psfile = PDFDocument + '.ps';
lv_old_printer = WordApp#.ActivePrinter;
WordApp#.ActivePrinter = 'FreePDF';
WordApp#.Documents.Open(XMLDocument, false, true);
line 5274 WordApp#.PrintOut(0, 0, 0, lv_psfile, , , , , , , true);
line 5275 WordApp#.PrintOut(, , 4, , , , , , '0', , false);
line 5276 WordApp#.ActivePrinter = lv_old_printer;
WordApp#.Quit(false);
WordApp# = NULL;
Colin Hay
Senior Database Administrator
Fintechnix
Level 5,
66 Clarence Street,
Sydney
coli...@fintechnix.com
Phone: +61 2 8234 8276
--
You received this message because you are subscribed to the Google Groups "OpenROAD Users Mailing List" group.
To post to this group, send email to openroa...@googlegroups.com.
To unsubscribe from this group, send email to openroad-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openroad-users?hl=en.
Colin,
We have tried to use AcitveX with OpenROAD in the past and have never managed to get it to work reliably (admittedly this was with v 4.1 and we’ve not tried it since). We would find the same as you – it works on one machine but not on another identical (clone) machine.
The way we generate reports is as follows. I’m not sure how much mileage you’ll get from this in your case:
· Save information required for report to intermediate file in temporary folder.
· Process registry to find location of Office executable (winword.exe) & check file actually exists – I have code to do this (provided by another member of this group) if you’re interested
· Run word and open a pre-existing template, running a macro to process the data file.
· Process the data file to generate report & print if required, from word.
Regards,
Martin Bloomfield.
_________________________________________________
Application Developer & Database Administrator
IT Branch
Chemicals Regulation Directorate
Health and Safety Executive
YORK
Email: martin.b...@hse.gsi.gov.uk
Website: www.pesticides.gov.uk www.hse.gov.uk
P Save a tree... please don't print this e-mail unless you really need to
This email was received from the INTERNET and scanned by the Government Secure Intranet anti-virus service supplied by Cable&Wireless Worldwide in partnership with MessageLabs. (CCTM Certificate Number 2009/09/0052.) In case of problems, please call your organisation’s IT Helpdesk.
Communications via the GSi may be automatically logged, monitored and/or recorded for legal purposes.
--
You received this message because you are subscribed to the Google Groups "OpenROAD Users Mailing List" group.
To post to this group, send email to openroa...@googlegroups.com.
To unsubscribe from this group, send email to openroad-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openroad-users?hl=en.
*****************************************************************************************************************
Please note : Incoming and outgoing email messages are routinely monitored for compliance with our policy on the use of electronic communications and may be automatically logged, monitored and / or recorded for lawful purposes by the GSI service provider.
Interested in Occupational Health and Safety information?
Please visit the HSE website at the following address to keep yourself up to date
*****************************************************************************************************************