This discussion is archived
6 Replies Latest reply: Jun 19, 2013 5:38 AM by user151536 RSS

OLE2 to Client_ole2 issue

user151536 Newbie
Currently Being Moderated

Hi,

 

We want to migrate our server side ole2 functionality into client side for that wherever we are having ole2 i have changed it to client_ole2. It works perfect (to open a word application, to populate it with some data, save it in a physical folder and closing it) as same a ole2. But the issue is that while it "Quit" word application it opens and closes in the client machine even though if we set it as visible 0 while opening. The word is not visible to user during opening, populating, saving. But opens and closes when we issue Quit.

Code we used to open a word

application:=Client_ole2.create_obj('Word.Application');

Client_ole2.set_property(application, 'Visible',0);

documents:=Client_ole2.get_obj_property(application, 'Documents');

args:=Client_ole2.create_arglist;

Client_ole2.add_arg(args,v_template_loc);

document:=Client_ole2.invoke_obj(documents,'Open',args);

Client_ole2.destroy_arglist(args);

 

Code we used to close the word

args:=Client_ole2.create_arglist;

Client_ole2.add_arg(args,lv_output_path);

Client_ole2.invoke(document,'SaveAs', args);

Client_ole2.destroy_arglist(args);

Client_ole2.invoke(documents,'Close');

 

Client_ole2.release_obj(selection);

Client_ole2.release_obj(document);

Client_ole2.release_obj(documents);--till here word is not visible in client (only service will be there)

Client_ole2.invoke(application,'Quit'); --Here it opens and closed word file which we populated

Client_ole2.release_obj(application);

 

Same code with ole2 doesn't opens a word in server in visible mode. Please help us to overcome this inconvenience.

 

This happens in MS Office 2003. But in MS Office 2007 word application is not opens a word file but shows only in the taskbar.

 

Thanks,

Balaji M

  • 1. Re: OLE2 to Client_ole2 issue
    Michael Ferrante (Oracle) Guru Moderator
    Currently Being Moderated

    Using the WebUtil Demo with Forms 11.1.2.1, I cannot reproduce what you described.  You may want to consider reviewing the example code found in the demo.  It can be downloaded from here:

     

    http://www.oracle.com/technetwork/developer-tools/forms/downloads/index.html

  • 2. Re: OLE2 to Client_ole2 issue
    user151536 Newbie
    Currently Being Moderated

    Thank you Michael Ferrante.

     

    We are currently using 10gR2 where we got this issue. we'll test it in 11.1.2.1 and come back.

     

    Regards,

    Balaji M

  • 3. Re: OLE2 to Client_ole2 issue
    user151536 Newbie
    Currently Being Moderated

    Hi,

    I have tested the same with Weblogic Server 10.3.6 and forms 11.1.2.1.0 with 64 bit Server. Still after populating the word application when we issue 'Quit' a word is opened and closed immediately. Even though its very fast (we cant see the content) its inconvenient since again we are opening the file for the user and when generates multiple file.

    Client : Windows Xp with Office 2003

     

    Please help us to overcome this.

  • 4. Re: OLE2 to Client_ole2 issue
    Michael Ferrante (Oracle) Guru Moderator
    Currently Being Moderated

    Did you test with the WebUtil Demo as I previously recommended?

  • 5. Re: OLE2 to Client_ole2 issue
    user151536 Newbie
    Currently Being Moderated

    Thanks for your response.

    I have tested our working version code of ole2 as client_ole2 in 11g. Anyhow i'll test the webutil demo.

  • 6. Re: OLE2 to Client_ole2 issue
    user151536 Newbie
    Currently Being Moderated

    I have tested the below code in the 11gR2 with Office 2003 on xp. Still a populated word opens and closes.

     

    DECLARE

    application  Client_ole2.obj_type;

    documents    Client_ole2.obj_type;

    document     Client_ole2.obj_type;

    selection    Client_ole2.obj_type;

    args         Client_ole2.list_type;

    BEGIN

    application:=Client_ole2.create_obj('Word.Application');

    Client_ole2.set_property(application, 'Visible',0);

    documents:=Client_ole2.get_obj_property(application, 'Documents');

    args:=Client_ole2.create_arglist;

    Client_ole2.add_arg(args,'C:\plasworkdir\TEST.dot');

    document:=Client_ole2.invoke_obj(documents,'Open',args);

    Client_ole2.destroy_arglist(args);

     

    selection:= Client_ole2.get_obj_property(application, 'Selection');

    args:=Client_ole2.create_arglist;

    Client_ole2.add_arg(args,-1);

    Client_ole2.add_arg(args,0);

    Client_ole2.add_arg(args,0);

    Client_ole2.add_arg(args,'BM');

    Client_ole2.invoke(selection,'GoTo',args);

    Client_ole2.destroy_arglist(args);

    Client_ole2.set_property(selection, 'Text',NVL(:TEXT_ITEM5,'EMPTY'));   

     

    args:=Client_ole2.create_arglist;

    Client_ole2.add_arg(args,'C:\plasworkdir\'||:TEXT_ITEM6||'.doc');

    Client_ole2.invoke(document,'SaveAs', args);

    Client_ole2.destroy_arglist(args);

    Client_ole2.invoke(documents,'Close');

           

    Client_ole2.release_obj(selection);

    Client_ole2.release_obj(document);

    Client_ole2.release_obj(documents);

    Client_ole2.invoke(application,'Quit');

    Client_ole2.release_obj(application);

    END;

     

    Your help is much appreciated in advance.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points