<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>20 Mar 2020 12:56:37 Z</lastBuildDate><pubDate>23 Jan 2017 12:04:34 Z</pubDate><description>Hi all,&#13;
I have problems with automation and new version of Office.&#13;
With version 2010 it is all ok!&#13;
I'll try to replace a string in a .doc document, but it seems to me word 2016 did not respond to automation.&#13;
I can open the file but when I close automation in task-manager i see winword.exe running...&#13;
It is possible that there is a security mechanism so automation in blocked?&#13;
Anyone had this problems?&#13;
&#13;
My code is like this:&#13;
&#13;
// check whether Word is found and retrieve its version&#13;
nVersion is int&#13;
nVersion = nVersionOffice("Word")&#13;
IF nVersion = 0 THEN&#13;
	Error("Word non è installato su questo computer, non puoi usare questa funzione")&#13;
	RETURN&#13;
END&#13;
IF nVersion &lt; 8 THEN&#13;
	Error("Per usare questa funzione devi avere installato Word 97 o successivo")&#13;
	RETURN	&#13;
END&#13;
&#13;
sNomeFile, sNomeFileTmp is string&#13;
sNomeFile=CompleteDir(ExeInfo(exeDirectory))+"myfile.doc"&#13;
sNomeFileTmp="c:\temp\myfile.doc"&#13;
&#13;
IF fFileExist(sNomeFile) THEN&#13;
	fCopyFile(sNomeFile,sNomeFileTmp)&#13;
END&#13;
&#13;
IF NOT fFileExist(sNomeFileTmp) THEN&#13;
	Error("File myfile.doc non presente")&#13;
	RETURN&#13;
END&#13;
&#13;
ChiudiWord()&#13;
&#13;
pautMyWord=new object Automation "Word.application"&#13;
&#13;
pautMyWord&gt;&gt;documents&gt;&gt;Open(sNomeFileTmp, True, True)&#13;
//pautMyWord&gt;&gt;Visible=False&#13;
&#13;
WHEN EXCEPTION IN&#13;
	pautMyWord&gt;&gt;Selection	&#13;
DO&#13;
	Error("MyWordSelection")&#13;
	GOTO FINE&#13;
END&#13;
&#13;
//   1: WdFindContinue &#13;
//   2: WdReplaceAll &#13;
WHEN EXCEPTION IN&#13;
	pautMyWord&gt;&gt;Selection&gt;&gt;Find&gt;&gt;Execute("$DataLettera$",False,True,False,False,False,True,1,False,NoSpace(EDT_Data_Lettera),2)&#13;
DO&#13;
	Error("MyWordSelectionFindExecute_DataLettera", ErrorInfo(errFullDetails))&#13;
	GOTO FINE&#13;
END&#13;
WHEN EXCEPTION IN&#13;
	pautMyWord&gt;&gt;Selection&gt;&gt;Find&gt;&gt;Execute("$DataAggIta$",False,True,False,False,False,True,1,False,NoSpace(EDT_Data_Aggiornamento_ita),2)&#13;
DO&#13;
	Error("MyWordSelectionFindExecute_DataAggIta", ErrorInfo(errFullDetails))&#13;
	GOTO FINE&#13;
END&#13;
WHEN EXCEPTION IN&#13;
	pautMyWord&gt;&gt;Selection&gt;&gt;Find&gt;&gt;Execute("$DataAggEng$",False,True,False,False,False,True,1,False,NoSpace(EDT_Data_Aggiornamento_eng),2)&#13;
DO&#13;
	Error("MyWordSelectionFindExecute_DataAggEng", ErrorInfo(errFullDetails))&#13;
	GOTO FINE&#13;
END&#13;
&#13;
pautMyWord&gt;&gt;Visible=True&#13;
&#13;
FINE:&#13;
&#13;
&#13;
Then in the close procedure of the window:&#13;
&#13;
WHEN EXCEPTION IN&#13;
	pautMyWord&gt;&gt;documents&gt;&gt;Close(0)&#13;
	pautMyWord&gt;&gt;Application&gt;&gt;Quit&#13;
	&#13;
	delete pautMyWord&#13;
DO&#13;
END&#13;
&#13;
but winword.exe is still executing after close.&#13;
&#13;
Tnx&#13;
&#13;
Andrea</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/60642-word-2016-and-automation/read.awp</link><title>WORD 2016 and automation</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>antonino.neri</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/60642-word-2016-and-automation-67704/read.awp</comments><pubDate>20 Mar 2020 12:56:37 Z</pubDate><description>Hi Gents,&#13;
&#13;
it seems that this problem is still present in Windev 24. Was anyone able to find a workaround and quit Word via OL…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/60642-word-2016-and-automation-67704/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/60642-word-2016-and-automation-67704/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/60642-word-2016-and-automation/read.awp">WORD 2016 and automation</source><title>Re: WORD 2016 and automation</title></item></channel></rss>
