ID:145861
 
Code:
        Load_Document(f as file)
if(!window)
window=1
var/a=file2text(f) // The text contained in the f variable file.
var/b=input(src,"","[f]",a)as null|message // a is set to the default message that's displayed
if(b)
var/c=input("Where would you like the file to be placed?","Word Document")as null|text
if(c)
if(text2file("[b]","[c][f]")) src<<"<b>Document saved successfully.</b>"
else src<<"<font color=red face=courier new>ERROR: Failed writing text to document.</font>"
else if(b=="") src<<"<font color=red face=courier new>ERROR: Document contains no data, will not be written.</font>"
window=0


Fixed.