// Hook: AfterPacketGeneration // Stamp the workbook's built-in document properties with job metadata. // // SharePoint, Box and other DMS systems index these properties without having // to crack the file open and scrape cell content. Driven entirely by job // parameters and runtime metadata. if (Workbook == null) { AddWarning($"No workbook available for '{OutputName}'; skipping document properties."); return; } var props = Workbook.BuiltInDocumentProperties; props.Title = JobName; props.Subject = OutputName; props.Author = Parameters.TryGetValue("Author", out var author) ? author : "ReportWORQ"; props.Company = Parameters.TryGetValue("Company", out var company) ? company : props.Company; props.Comments = $"Generated by ReportWORQ on {DateTime.UtcNow:yyyy-MM-ddTHH:mm:ssZ}."; if (Parameters.TryGetValue("Region", out var region) && !string.IsNullOrWhiteSpace(region)) props.Keywords = $"ReportWORQ;{region};{DateTime.UtcNow:yyyy-MM}"; Logger.LogInformation($"Stamped document properties for '{OutputName}'.");