Setting Extended File Properties in .NET
If you need to modify the Company field value or other extended file properties within Word or PDF documents, here's how you can do it using .NET:
Install NuGet Packages:
Add the following NuGet packages to your project:
using Microsoft.WindowsAPICodePack.Shell; using Microsoft.WindowsAPICodePack.Shell.PropertySystem; string filePath = @".\example.docx"; var file = ShellFile.FromFilePath(filePath); // Read the old properties string[] oldAuthors = file.Properties.System.Author.Value;
The above is the detailed content of How Can I Modify Extended File Properties (Like Company) in Word or PDF Documents Using .NET?. For more information, please follow other related articles on the PHP Chinese website!