I have the following code inside my sharepoint event reciever to copy a .oft file inside a document library and paste it inside a new destination (another document library):-
SPDocumentLibrary template = (SPDocumentLibrary)properties.Web.GetList(properties.Web.ServerRelativeUrl + "/Templates/");
SPListItem templetefile = null;
foreach (SPListItem i in template.Items)
{
if (i.Name.ToLower().Contains("project"))
{
templetefile = i;
}
}
byte[] fileBytes = templetefile.File.OpenBinary();
string destUrl = properties.Web.ServerRelativeUrl + "/" + projectid.RootFolder.Url +".oft";
SPFile destFile = projectid.RootFolder.Files.Add(destUrl, fileBytes, false);
now my code is working well. but i am not sure if i can access the .OFT file after its being copied, and modify its subject (by subject i mean i email subject) ??