I am running VFP 6 with serv pack 4 on Windows 95 machines. I use the getfile command to allow the user to select a word document to mail merge to. On 3 out of 25 machines, the getfile command only works once, if the user try again, it just ignores the command returns an empty character string and continues processing. It gives no error or anything. It happens very consistently on these three machines, but never on the others. The problem is isolated only to the run-time version of VFP. All of the machines are very, very similar as far as hardware and software installed.
Any and all suggestions well be greatly appreciated. Or if anyone knows of freeware code that would simulate the get file command that might be a simple work-around.
Thanks :-)
Eddie
Here is example code of the problem:
set defa to n:\letters
for a=1 to 3
* the following line works fine once, but not twice on 3 machines
xfile=getfile('doc','File Name','Merge',0,'Select Letter To Print')
if empty(xfile)
wait wind 'Variable xfile is empty'
else
do wordmerg with xfile
wait wind 'Wordmerg finished - press any key'
endif
endfor
return
proc wordmerg
para document
public oWord
tmpsheet=getObject('','word.document')
oWord =tmpsheet.application
oWord.visible = .t.
oWord.WindowState=1
* the following line causes getfile command to become non-functional
oWord.application.documents.open("&document")
oWord.Activate()
rele oWord,tmpsheet
return
If Bill Gates had a penny for every time windows crashed he'd be... Oh wait he does!