Skip to content

v25.4.1

Choose a tag to compare

@sabir-aspose sabir-aspose released this 21 Apr 06:57
· 36 commits to main since this release
1ddab4d

What's Changed

Full Changelog: v25.4.0...v25.4.1

Usage Code Example

            var document = new Openize.Words.Document("word.docx");
            var oldProps = document.GetDocumentProperties();
            var props = new Openize.Words.DocumentProperties();

            // Helper to print and update
            void UpdateProperty<T>(string name, T oldValue, T newValue, Action<T> setValue)
            {
                Console.WriteLine($"Old {name} : {oldValue}");
                setValue(newValue);
                Console.WriteLine($"New {name} : {newValue}");
            }

            // Update metadata
            UpdateProperty("Title", oldProps.Title, "Updated Title", val => props.Title = val);
            UpdateProperty("Subject", oldProps.Subject, "Updated Subject", val => props.Subject = val);
            UpdateProperty("Description", oldProps.Description, "Updated Description", val => props.Description = val);
            UpdateProperty("Creator", oldProps.Creator, "Updated Creator", val => props.Creator = val);
            UpdateProperty("Keywords", oldProps.Keywords, "Updated.Keyword", val => props.Keywords = val);
            UpdateProperty("LastModifiedBy", oldProps.LastModifiedBy, "Updated.Openize.OpenXML-SDK", val => props.LastModifiedBy = val);
            UpdateProperty("Revision", oldProps.Revision, "Version.Revised", val => props.Revision = val);
            UpdateProperty("Created", oldProps.Created, oldProps.Created, val => props.Created = val);

            var currentTime = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ");
            UpdateProperty("Modified", oldProps.Modified, currentTime, val => props.Modified = val);

            document.SetDocumentProperties(props);
            document.Save("word2.docx");