Home » Developer & Programmer » Forms » Host Builtin
Host Builtin [message #82331] Mon, 19 May 2003 03:05 Go to next message
Mubeen
Messages: 44
Registered: February 2003
Member
Hi all,

I have given the following code for invoking ms-word from a form trigger by using when-button-pressed trigger at block level but ms-word is not invoking
please find below the code:-

begin
host((winword));

end;

If there is something wrong with the code please help me out.

thanx in advance

Mubeen.
Re: Host Builtin [message #82332 is a reply to message #82331] Mon, 19 May 2003 03:51 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Most likely, the winword.exe isn't located in your Path. Try one of the following:
1. With most work, but most flexible:
Declare
	-- variable to store the registry value that contains the path to Word
	word_path Varchar2(500);
	-- The registry path to word (in our case, Word97, i.e. version 8.0)
	v_registry_path Varchar2(150) := 'HKEY_LOCAL_MACHINESOFTWAREMICROSOFTOFFICE8.0WORDINSTALLROOT';
	-- The name of the registry key (in our case, InstallRoot);
	v_registry_key  Varchar2(150) := 'PATH';
Begin
	-- Retrieve the path from the registry
	word_path := Win_Api_Environment.Read_Registry (v_registry_path		,v_registry_key,TRUE);

	-- Trim the trailing double quote from the path and add the name of the exe.
	-- Value of word_path e.g.: "C:program filesmicrosoft officeoffice"
	word_path := (substr(word_path,1,instr(word_path,'"',-1)-1)||'winword.exe"');
  -- Value of word_path e.g.: "C:program filesmicrosoft officeofficewinword.exe"
  -- Invoke word.
	Host(word_path);
End;
This code retrieves the path of word from the registry and uses that to concatenate with the name of the exe. You need to attach D2KWUTIL.PLL (which can be found in the $ORACLE_HOME$TOOLSDEVDEM60DEMOFORMS directory). I don't know whether this registry path is generic (verify it first), but you could try to create code which spans a lot of word/office versions.

2.The most easy (less dynamic) solution is to add the office directory to your path. This means that *ALL* users need to do so.

MHE
Previous Topic: formatting numbers in text items
Next Topic: How to see multilanguage data in forms9i ?
Goto Forum:
  


Current Time: Thu Mar 28 21:05:43 CDT 2024