10 Replies Latest reply on Jun 22, 2012 4:53 PM by user1065650

    Getting WUO-700: Unable to create the OLE Server when using client_ole2.

    user1065650
      Getting the below error from this line in the below code listed below: objNS := CLIENT_OLE2.invoke_obj(objOutlook,'GetNameSpace',objArg);
      WUO-700: Unable to create the OLE Server
      Outlook.Application;Exception
      com.jacob.com.ComFailException: Can't get object clsid from progid

      100501:non-ORACLE exception

      Webutil and jacob are working fine and I am able to use client_ole2 to create appointments and contacts in the local users Outlook. However with the below code I'm trying to create appointments in other users Outlook.

      PROCEDURE make_app2 (p_subject char, p_location char, p_start date, p_end date, p_body char, p_min number) IS

      objOutlook CLIENT_OLE2.OBJ_TYPE;
      objNS CLIENT_OLE2.OBJ_TYPE;
      objRecip CLIENT_OLE2.OBJ_TYPE;
      objFolder CLIENT_OLE2.OBJ_TYPE;
      objAppt CLIENT_OLE2.OBJ_TYPE;
      p_string varchar2(60) := null;
      objArg CLIENT_OLE2.LIST_TYPE;
      t_resolved boolean := FALSE;

      BEGIN
      objOutlook := CLIENT_OLE2.CREATE_OBJ('Outlook.Application');
      objRecip := CLIENT_OLE2.CREATE_OBJ('Outlook.Recipient');
      objNS := CLIENT_OLE2.create_obj('Outlook.NameSpace');
      objArg := CLIENT_OLE2.CREATE_ARGLIST;
      CLIENT_OLE2.ADD_ARG(objArg,'MAPI');
      objNS := CLIENT_OLE2.invoke_obj(objOutlook,'GetNameSpace',objArg);
      CLIENT_OLE2.DESTROY_ARGLIST(objArg);
      objFolder := CLIENT_OLE2.CREATE_OBJ('Outlook.MAPIFolder');
      objAppt := CLIENT_OLE2.CREATE_OBJ('Outlook.AppointmentItem');

      p_string := 'ldehan@alliancepackaging.net';
      objRecip := CLIENT_OLE2.invoke_OBJ(objNS, 'CreateRecipient',p_string);
      objFolder := CLIENT_OLE2.invoke_OBJ('GetSharedDefaultFolder',objRecip, 'Outlook.olDefaultFolders.olFolderCalendar');

      --
      objArg := CLIENT_OLE2.CREATE_ARGLIST;
      CLIENT_OLE2.ADD_ARG(objArg,1);
      objAppt := CLIENT_OLE2.INVOKE_OBJ(objOutlook,'CreateItem', objArg);
      CLIENT_OLE2.DESTROY_ARGLIST(objArg);
      --
      --
      CLIENT_OLE2.SET_PROPERTY(objAppt,'subject', p_subject);
      CLIENT_OLE2.SET_PROPERTY(objAppt,'location', p_location);
      CLIENT_OLE2.SET_PROPERTY(objAppt,'body', p_body);
      CLIENT_OLE2.SET_PROPERTY(objAppt,'start', TO_CHAR(p_start,'DD/MM/YYYY HH24:MI' ));
      CLIENT_OLE2.SET_PROPERTY(objAppt,'end', TO_CHAR(p_end,'DD/MM/YYYY HH24:MI'));
      CLIENT_OLE2.SET_PROPERTY(objAppt,'ReminderMinutesBeforeStart', p_min);


      --
      CLIENT_OLE2.INVOKE(objAppt, 'Save');
      --
      CLIENT_OLE2.RELEASE_OBJ(objAppt);
      CLIENT_OLE2.RELEASE_OBJ(objOutlook);
      CLIENT_OLE2.RELEASE_OBJ(objNS);
      CLIENT_OLE2.RELEASE_OBJ(objRecip);
      CLIENT_OLE2.RELEASE_OBJ(objFolder);

      Exception
      When others then
      message(sqlcode||' '||sqlerrm);
      RAISE FORM_TRIGGER_FAILURE;
      END;

      Edited by: user1065650 on Jul 18, 2012 9:53 AM
        • 1. Re: Getting WUO-700: Unable to create the OLE Server when using client_ole2
          Amatu Allah Neveen Ebrahim
          Hi
          For this kind of errors u have to mention forms version ,etc.

          Webutil Documentation mentioned the ...
          Resolution: Check that the OLE Server Application works standalone and the name has been specified correctly.
          well i made some search it says...

          1.make sure that the outlook on the computer.

          2.This Bug is fixed using pach 5983622 using jpi 1.5.0 (build 1.5.0_12-b04)

          3. i saw another thread ; outlook.application working no longer with outlook 2010

          Hope this helps...

          Regards,

          Amatu Allah
          • 2. Re: Getting WUO-700: Unable to create the OLE Server when using client_ole2.
            user1065650
            Forms version is 11.1.2.0 on Win2008 R2 64 bit.

            I'll take a look at the patch you mentioned. Reminder that webutil is working fine and that I can already use client_ole2 to create contacts and appointments in Outlook. The difference with this new code is that I'm trying to create them on a different users Outlook calendar.

            Edited by: user1065650 on Jun 14, 2012 7:43 AM
            • 4. Re: Getting WUO-700: Unable to create the OLE Server when using client_ole2
              Amatu Allah Neveen Ebrahim
              Hi
              Patch 5983622 is for version 10.1.2.3.
              i know , if it is really worth then you have to upgrade Forms to 10.1.2.3.0 in ur laptop for testing purposes...

              Every patch contains a readme.txt ; you just need to follow the instructions.

              But if i were u i would think of other solution easier pls try to re-install Microsoft office older version as 2007 or 2003 this could solve ur problem.


              Regards,

              Amatu Allah

              Edited by: Amatu Allah on Jun 15, 2012 12:33 AM
              • 5. Re: Getting WUO-700: Unable to create the OLE Server when using client_ole2.
                user1065650
                I can't use that patch, I am on F/R server version 11.1.2.0.
                • 6. Re: Getting WUO-700: Unable to create the OLE Server when using client_ole2.
                  Fazal Rehman
                  com.jacob.com.ComFailException_
                  it seems there is jacob problem plz check your jacob version and also plz generate the .plx
                  and do not forget to sign jacob.jar.



                  sarah
                  • 7. Re: Getting WUO-700: Unable to create the OLE Server when using client_ole2.
                    user1065650
                    I figured out the issue. The middle tier server (Forms & Reports) needed Outlook installed on it to have access to it's functionality. I no longer get the WUO-700 error. However I am getting ORA-06502 from this line in the code. Any ideas would be helpful.

                    objRecip := CLIENT_OLE2.invoke_OBJ(objNS, 'CreateRecipient',p_string);
                    • 8. Re: Getting WUO-700: Unable to create the OLE Server when using client_ole2.
                      Fazal Rehman
                      hi

                      plz try this code.
                      Send Button.(when-button-pressed trigger)
                      DECLARE
                      OutlookApp client_ole2.OBJ_TYPE;
                      NameSpace client_ole2.OBJ_TYPE;
                      MailItem client_ole2.OBJ_TYPE;
                      OLEPARAM client_ole2.LIST_TYPE;
                      Send client_ole2.OBJ_TYPE;
                      Attachments client_ole2.OBJ_TYPE;
                      Attachment_dummy client_ole2.OBJ_TYPE;
                      var1   varchar2(2000);
                      emailadd varchar2(2000);
                      
                      Begin
                      
                      --assign a value to the variable from the Oracle Form
                      -- var1 := :BLOCK5.txt5;
                      
                      --but for testing, populate the variable 'by hand'
                      var1 := ' ';
                      
                      OutlookApp := client_ole2.CREATE_OBJ('Outlook.Application');
                      
                      
                      OLEPARAM := client_ole2.CREATE_ARGLIST;
                      
                      
                      client_ole2.ADD_ARG(OLEPARAM,'MAPI');
                      NameSpace := client_ole2.INVOKE_OBJ(OutlookApp,'GetNameSpace',OLEPARAM);
                      client_ole2.DESTROY_ARGLIST(OLEPARAM);
                      
                      
                      OLEPARAM := client_ole2.CREATE_ARGLIST;
                      client_ole2.ADD_ARG(OLEPARAM,0);
                      MailItem := client_ole2.INVOKE_OBJ(OutlookApp,'CreateItem',OLEPARAM);
                      client_ole2.DESTROY_ARGLIST(OLEPARAM);
                      
                      
                      client_ole2.SET_PROPERTY(MailItem,'To',:email);
                      
                      client_ole2.SET_PROPERTY(MailItem,'Subject',:subject);
                      if :block.check = 'Y' then
                      client_ole2.SET_PROPERTY(MailItem,'cc',:cc);
                      end if;
                      --client_ole2.SET_PROPERTY(MailItem,'Subject',:subject);
                      client_ole2.SET_PROPERTY(MailItem,'Body', :message ||var1);
                      
                      
                      --add an attachment
                      Attachments := client_ole2.GET_OBJ_PROPERTY(MailItem,'Attachments');
                      OLEPARAM := client_ole2.CREATE_ARGLIST;
                      client_ole2.ADD_ARG(OLEPARAM,:b.filepath);
                      Attachment_dummy := client_ole2.INVOKE_OBJ(Attachments,'add',OLEPARAM);
                      client_ole2.DESTROY_ARGLIST(OLEPARAM);
                      
                      
                      Send := client_ole2.INVOKE_OBJ(MailItem,'Send');
                      
                      
                      --destroy objects
                      client_ole2.RELEASE_OBJ(MailItem);
                      client_ole2.RELEASE_OBJ(NameSpace);
                      client_ole2.RELEASE_OBJ(OutlookApp);
                      
                      
                      END; 
                      attachment button(when-button-pressed trigger)
                      DECLARE
                      OutlookApp client_ole2.OBJ_TYPE;
                      Attachments client_ole2.OBJ_TYPE;
                      Attachment_dummy client_ole2.OBJ_TYPE;
                      MailItem client_ole2.OBJ_TYPE;
                      OLEPARAM client_ole2.LIST_TYPE;
                      NameSpace client_ole2.OBJ_TYPE;
                      filepath varchar2(2000);
                      begin
                           --add an attachment
                      filepath := CLIENT_GET_FILE_NAME (File_Filter => 'PDF (*.PDF,*.txt,*.doc)|*.*|'); 
                      --filepath :=webutil_file.file_open_dialog();
                                if filepath is not null then
                             :block.filepath := filepath;
                           
                                end if;
                      Attachments := CLIENT_OLE2.GET_OBJ_PROPERTY(MailItem,'Attachments');
                      OLEPARAM := CLIENT_OLE2.CREATE_ARGLIST;
                      CLIENT_OLE2.ADD_ARG(OLEPARAM,filepath);
                      Attachment_dummy := CLIENT_OLE2.INVOKE_OBJ(Attachments,'add',OLEPARAM);
                      CLIENT_OLE2.DESTROY_ARGLIST(OLEPARAM);
                      
                      
                      --destroy objects
                      client_ole2.RELEASE_OBJ(MailItem);
                      client_ole2.RELEASE_OBJ(NameSpace);
                      client_ole2.RELEASE_OBJ(Attachment_dummy);
                      
                      END; 
                      hope this helps you.

                      sarah
                      • 9. Re: Getting WUO-700: Unable to create the OLE Server when using client_ole2.
                        user1065650
                        Sarah,
                        Your code does sends an email successfully. Not sure though how this helps with my issue.
                        • 10. Re: Getting WUO-700: Unable to create the OLE Server when using client_ole2.
                          user1065650
                          I have modified my code as below. Getting a little further along but it now fails at this line of code objFolder := CLIENT_OLE2.invoke_OBJ(objRecip, 'GetSharedDefaultFolder',objArg);

                          with this error:
                          WUO-705: Unable to invoke Method:
                          GetSharedDefaultFolder; Exception
                          com.jacob.com.ComFailException: Can't map name
                          to dispid: GetSharedDefaultFolder

                          PROCEDURE make_app2 (p_subject char, p_location char, p_start date, p_end date, p_body char, p_min number) IS

                          objOutlook CLIENT_OLE2.OBJ_TYPE;
                          objNS CLIENT_OLE2.OBJ_TYPE;
                          objRecip CLIENT_OLE2.LIST_TYPE;
                          objFolder CLIENT_OLE2.OBJ_TYPE;
                          objAppt CLIENT_OLE2.OBJ_TYPE;
                          p_string varchar2(60) := null;
                          objArg CLIENT_OLE2.LIST_TYPE;

                          BEGIN
                          objOutlook := CLIENT_OLE2.CREATE_OBJ('Outlook.Application');
                          objArg := CLIENT_OLE2.CREATE_ARGLIST;
                          CLIENT_OLE2.ADD_ARG(objArg,1);
                          objAppt := CLIENT_OLE2.INVOKE_OBJ(objOutlook,'CreateItem', objArg);
                          CLIENT_OLE2.DESTROY_ARGLIST(objArg);
                          objArg := CLIENT_OLE2.CREATE_ARGLIST;
                          CLIENT_OLE2.ADD_ARG(objArg,'MAPI');
                          objNS := CLIENT_OLE2.invoke_obj(objOutlook,'GetNameSpace',objArg);
                          CLIENT_OLE2.DESTROY_ARGLIST(objArg);
                          p_string := 'Louis DeHan';
                          objArg := CLIENT_OLE2.CREATE_ARGLIST;
                          CLIENT_OLE2.ADD_ARG(objArg,p_string);
                          objRecip := CLIENT_OLE2.invoke_OBJ(objNS, 'CreateRecipient',objArg);
                          CLIENT_OLE2.DESTROY_ARGLIST(objArg);
                          objArg := CLIENT_OLE2.CREATE_ARGLIST;
                          CLIENT_OLE2.ADD_ARG(objArg,'olFolderCalendar');
                          objFolder := CLIENT_OLE2.invoke_OBJ(objRecip, 'GetSharedDefaultFolder',objArg);
                          CLIENT_OLE2.DESTROY_ARGLIST(objArg);
                          -- objFolder := CLIENT_OLE2.invoke_OBJ('GetSharedDefaultFolder',objRecip, 'Outlook.olDefaultFolders.olFolderCalendar');
                          --

                          --
                          CLIENT_OLE2.SET_PROPERTY(objAppt,'subject', p_subject);
                          CLIENT_OLE2.SET_PROPERTY(objAppt,'location', p_location);
                          CLIENT_OLE2.SET_PROPERTY(objAppt,'body', p_body);
                          CLIENT_OLE2.SET_PROPERTY(objAppt,'start', TO_CHAR(p_start,'DD/MM/YYYY HH24:MI' ));
                          CLIENT_OLE2.SET_PROPERTY(objAppt,'end', TO_CHAR(p_end,'DD/MM/YYYY HH24:MI'));
                          CLIENT_OLE2.SET_PROPERTY(objAppt,'ReminderMinutesBeforeStart', p_min);

                          --
                          CLIENT_OLE2.INVOKE(objAppt, 'Save');
                          --
                          CLIENT_OLE2.RELEASE_OBJ(objAppt);
                          CLIENT_OLE2.RELEASE_OBJ(objOutlook);
                          CLIENT_OLE2.RELEASE_OBJ(objNS);
                          CLIENT_OLE2.RELEASE_OBJ(objRecip);
                          CLIENT_OLE2.RELEASE_OBJ(objFolder);

                          Exception
                          When others then
                          message(sqlcode||' '||sqlerrm);
                          RAISE FORM_TRIGGER_FAILURE;
                          END;