Home » Developer & Programmer » Forms » knowing the path of word automaticly (developer 10g or 6i)
knowing the path of word automaticly [message #403646] Sun, 17 May 2009 20:08 Go to next message
mustafagamiel
Messages: 17
Registered: April 2009
Location: Egypt
Junior Member

Dear all
If I want to use microsoft word I write host then the path
but if the path in another partion then the word will not work
so how can I determine automatic the path in stead of I write it
Re: knowing the path of word automaticly [message #403777 is a reply to message #403646] Mon, 18 May 2009 10:28 Go to previous messageGo to next message
mustafagamiel
Messages: 17
Registered: April 2009
Location: Egypt
Junior Member

My Dears
still waiting the answer
Re: knowing the path of word automaticly [message #403780 is a reply to message #403777] Mon, 18 May 2009 10:54 Go to previous messageGo to next message
klat
Messages: 87
Registered: May 2009
Location: Mumbai
Member

have you tried ole2 functions to open word.

  declare
    application 	OLE2.OBJ_TYPE;
  begin
    application := OLE2.CREATE_OBJ('Word.Application');
    OLE2.SET_PROPERTY(application,'Visible','True');
    OLE2.INVOKE(application,'AppShow');
  end;


Re: knowing the path of word automaticly [message #403791 is a reply to message #403780] Mon, 18 May 2009 13:35 Go to previous messageGo to next message
mustafagamiel
Messages: 17
Registered: April 2009
Location: Egypt
Junior Member

thank you sir
but this make the application open with no document
could you help me more to make it open new document automatic

thanx alot

[Updated on: Mon, 18 May 2009 13:38]

Report message to a moderator

Re: knowing the path of word automaticly [message #403924 is a reply to message #403791] Tue, 19 May 2009 09:50 Go to previous messageGo to next message
klat
Messages: 87
Registered: May 2009
Location: Mumbai
Member

Try this

declare
  app       CLIENT_OLE2.OBJ_TYPE;
  docs      CLIENT_OLE2.OBJ_TYPE;    
  doc       CLIENT_OLE2.OBJ_TYPE; 
  selection CLIENT_OLE2.OBJ_TYPE; 
  args      CLIENT_OLE2.LIST_TYPE;
BEGIN
  -- create a new document
  app := OLE2.CREATE_OBJ('Word.Application');
  if :ole.silent = 'Y' 
  then
    OLE2.SET_PROPERTY(app,'Visible',0);
  else
    OLE2.SET_PROPERTY(app,'Visible',1);
  end if;
  
  docs := OLE2.GET_OBJ_PROPERTY(app, 'Documents');
  doc  := OLE2.INVOKE_OBJ(docs, 'add');
  
  selection := OLE2.GET_OBJ_PROPERTY(app, 'Selection');

  -- insert data into new document from long item
  OLE2.SET_PROPERTY(selection, 'Text', :ole.oletext);

  -- save document as example.tmp
  args := OLE2.CREATE_ARGLIST;
  OLE2.ADD_ARG(args, :ole.filename);
  OLE2.INVOKE(doc, 'SaveAs', args);
  OLE2.DESTROY_ARGLIST(args);

  -- close example.tmp
  args := CLIENT_OLE2.CREATE_ARGLIST;
  OLE2.ADD_ARG(args, 0);
  OLE2.INVOKE(doc, 'Close', args);
  OLE2.DESTROY_ARGLIST(args);
 
  OLE2.RELEASE_OBJ(selection);
  OLE2.RELEASE_OBJ(doc); 
  OLE2.RELEASE_OBJ(docs); 
 
 -- exit MSWord 
  OLE2.INVOKE(app,'Quit');
  
END;
Re: knowing the path of word automaticly [message #403926 is a reply to message #403791] Tue, 19 May 2009 09:53 Go to previous messageGo to next message
klat
Messages: 87
Registered: May 2009
Location: Mumbai
Member

Try this

declare
  app       CLIENT_OLE2.OBJ_TYPE;
  docs      CLIENT_OLE2.OBJ_TYPE;    
  doc       CLIENT_OLE2.OBJ_TYPE; 
  selection CLIENT_OLE2.OBJ_TYPE; 
  args      CLIENT_OLE2.LIST_TYPE;
BEGIN
  -- create a new document
  app := OLE2.CREATE_OBJ('Word.Application');
  if :ole.silent = 'Y' 
  then
    OLE2.SET_PROPERTY(app,'Visible',0);
  else
    OLE2.SET_PROPERTY(app,'Visible',1);
  end if;
  
  docs := OLE2.GET_OBJ_PROPERTY(app, 'Documents');
  doc  := OLE2.INVOKE_OBJ(docs, 'add');
  
  selection := OLE2.GET_OBJ_PROPERTY(app, 'Selection');

  -- insert data into new document from long item
  OLE2.SET_PROPERTY(selection, 'Text', :ole.oletext);

  -- save document as example.tmp
  args := OLE2.CREATE_ARGLIST;
  OLE2.ADD_ARG(args, :ole.filename);
  OLE2.INVOKE(doc, 'SaveAs', args);
  OLE2.DESTROY_ARGLIST(args);

  -- close example.tmp
  args := CLIENT_OLE2.CREATE_ARGLIST;
  OLE2.ADD_ARG(args, 0);
  OLE2.INVOKE(doc, 'Close', args);
  OLE2.DESTROY_ARGLIST(args);
 
  OLE2.RELEASE_OBJ(selection);
  OLE2.RELEASE_OBJ(doc); 
  OLE2.RELEASE_OBJ(docs); 
 
 -- exit MSWord 
  OLE2.INVOKE(app,'Quit');
  
END;
Re: knowing the path of word automaticly [message #403935 is a reply to message #403926] Tue, 19 May 2009 10:36 Go to previous message
mustafagamiel
Messages: 17
Registered: April 2009
Location: Egypt
Junior Member

thanks thanks
Previous Topic: Parent form should commit or rollback regardless of child form
Next Topic: webutil documentation
Goto Forum:
  


Current Time: Fri Dec 09 02:04:48 CST 2016

Total time taken to generate the page: 0.11479 seconds