Be sure to add ShellAPI and ShlOBJ to your uses clause.
procedure AddtoDocMenu(fName : String);
begin
SHAddToRecentDocs(SHARD_PATH, PChar(fName));
end;