MgtHargreaves
Programmer
I am hoping that some-one else has come across a problem we have encountered recently. We have a 'vertical market' product used by over 100 customers, and now have a problem with 3 of these.
If a Word document is open (via Word) on the system, and then the software opens another Word document using automation, everything is OK until the user closes the document created by the software. A message saying that the normal.dotm is in use by another user is displayed. The code in use is as follows :
By changing the code to
the problem goes away.
We have around 45 situations in the software using Word automation, and the majority are not as simple as this case, so the solution above will not be sufficient.
All three machines are running Word 2007, 2 are Windows 8 and one is XP.
Any thoughts gratefully received.
Margaret Hargreaves
If a Word document is open (via Word) on the system, and then the software opens another Word document using automation, everything is OK until the user closes the document created by the software. A message saying that the normal.dotm is in use by another user is displayed. The code in use is as follows :
Code:
m.cfile = "file name"
oWord = CREATEOBJECT("Word.Application")
oWord.Documents.Add (m.cfile)
oWord.Visible = .T.
oWord.Application.Activate
RELEASE oWord
Code:
m.nAns = ShellExecute(0,"open",cFile,"","",1)
We have around 45 situations in the software using Word automation, and the majority are not as simple as this case, so the solution above will not be sufficient.
All three machines are running Word 2007, 2 are Windows 8 and one is XP.
Any thoughts gratefully received.
Margaret Hargreaves