Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using OLE2 and Oracle Forms to convert to PDF

711 views
Skip to first unread message

Nathan Hynes

unread,
Jul 8, 2002, 7:20:55 AM7/8/02
to
Hi there

I wonder if anyone can help, i have added some code to an Oracle Form i have created (please see below) which opens up Microsoft Word, and then runs the 'convertToPDF' macro which gets installed in Word when you instal AdobeAcrobat. This then successfully converts my existing Word document to a PDF file. However, a 'Save PDF As' dialog appears each time i run this macro, and i cannot see a way of paramterising this box and stopping it from appearing. Im sure there must be a way round this, and if anyone has an idea, or an example piece of code i could use to get round this, i would be very grateful.

The code i have currently is set out below:-

Declare

DOCUMENT OLE2.LIST_TYPE;
  PATH OLE2.LIST_TYPE;
  MACROEX OLE2.LIST_TYPE;

WORD_OBJ OLE2.OBJ_TYPE;
  WORD_DOC OLE2.OBJ_TYPE;
  WORD_FILE OLE2.OBJ_TYPE;

Begin

WORD_OBJ := OLE2.CREATE_OBJ('word.application');

OLE2.SET_PROPERTY(WORD_OBJ, 'Visible', 'True');

DOCUMENT := OLE2.CREATE_ARGLIST;
  MACROEX := OLE2.CREATE_ARGLIST;

OLE2.ADD_ARG(DOCUMENT, 'C:\1\x.doc');
  OLE2.ADD_ARG(DOCUMENT, 0);
  OLE2.ADD_ARG(DOCUMENT, 0);

OLE2.ADD_ARG(MACROEX, 'ConvertToPDF');

WORD_DOC := OLE2.GET_OBJ_PROPERTY(WORD_OBJ, 'DOCUMENTS');

WORD_FILE := OLE2.INVOKE_OBJ(WORD_DOC, 'OPEN', DOCUMENT);
  OLE2.INVOKE(WORD_OBJ, 'RUN', MACROEX);

OLE2.DESTROY_ARGLIST(DOCUMENT);
  OLE2.DESTROY_ARGLIST(MACROEX);

END;

William A. Davis

unread,
Jul 8, 2002, 8:14:37 PM7/8/02
to
Generally you go to the settings of the Distiller Driver and turn off the box that asks to check for a file name. It is then put in Adobe's choice of locations (typically a subfolder of My Documents) and names it based on the current document name.
0 new messages