I'm using office 97 and I have a word macro which inserts a text file from the server (along with several pie charts).
I dynamically write a text file to the server and insert this text file into the word document.
If the user launches the word document a second time, I want to delete the text file out there on the server, create a new text file, and then insert this latest copy into the word document.
The problem is that the macro inserts the old text file and never grabs the latest copy.
I delete the old file from a c program with this code:
------------------------------------------
sprintf(path,"/home/winshares/Data/wam%s/% d/yb_appr.doc",state.code,state.bu
dget_yr);
filename = path;
remove(filename);
fh = fopen(filename,"w"
;
-----------------------------------------
Then, inside the macro with vba code, I insert the new text file with this code:
-----------------------------------------
Selection.InsertFile FileName:=FileNm, Range:="", _
ConfirmConversions:=False, Link:=False, Attachment:=False
-----------------------------------------
Does anyone see anything wrong with this code or is there some parameter that I can specify so that the old text file will not be cached and that I can get the latest version of the text file?
Thanks in Advance.
John
I dynamically write a text file to the server and insert this text file into the word document.
If the user launches the word document a second time, I want to delete the text file out there on the server, create a new text file, and then insert this latest copy into the word document.
The problem is that the macro inserts the old text file and never grabs the latest copy.
I delete the old file from a c program with this code:
------------------------------------------
sprintf(path,"/home/winshares/Data/wam%s/% d/yb_appr.doc",state.code,state.bu
dget_yr);
filename = path;
remove(filename);
fh = fopen(filename,"w"
-----------------------------------------
Then, inside the macro with vba code, I insert the new text file with this code:
-----------------------------------------
Selection.InsertFile FileName:=FileNm, Range:="", _
ConfirmConversions:=False, Link:=False, Attachment:=False
-----------------------------------------
Does anyone see anything wrong with this code or is there some parameter that I can specify so that the old text file will not be cached and that I can get the latest version of the text file?
Thanks in Advance.
John