BuiltInDocumentProperties.NameOfApplication not respected when saving DOCX file

I noticed that when I set

Document.BuiltInDocumentProperties.NameOfApplication = "My Application";

the file ends up with a “Program name” value of “Microsoft Office Word”, regardless of what I chose to set it to.

AsposeWordsDocxFileProperties.PNG (10.7 KB)

It looks like a similar issue was reported in 2011, however this has possibly been reintroduced or was only patched for PDF files, whereas I’m saving the document using SaveFormat.Docx.

I also noticed that the Version field also remains empty even when I set Document.BuiltInDocumentProperties.Version = 1

Any thoughts?

@owenb6eee,

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-16305. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

1 Like

@owenb6eee,

Thanks for your patience. Please note that Aspose.Words mimics the behavior of MS Word. After first investigation, we have noticed that the MS Word does not allow to change the “Program name” property. So, its value is “Microsoft Office Word”. You cannot change it.

Regarding version field, please share your expected output document. This will help us to understand your requirement. Thanks for your cooperation.

Thanks for investigating the Program Name issue, makes sense.

I have attached my output document after attempting to set the Version Number, along with a screenshot of the document properties and the code used to generate the document.

AsposeWordsDocxFileProperties_Version.PNG (10.7 KB)
test.zip (docx inside) (5.0 KB)

static void Main(string[] args)
{
	var doc = new Document();
	var properties = doc.BuiltInDocumentProperties;
	properties.Author = "My Author";
	properties.Category = "My Category";
	properties.Comments = "My Comments";
	properties.Company = "My Company";
	properties.ContentStatus = "My ContentStatus";
	properties.CreatedTime = DateTime.Now;
	properties.Keywords = "My Keywords";
	properties.LastPrinted = DateTime.Now;
	properties.LastSavedBy = "My LastSavedBy";
	properties.Manager = "My Manager";
	properties.NameOfApplication = "My NameOfApplication";
	properties.RevisionNumber = 42;
	properties.Subject = "My Subject";
	properties.Title = "My Title";
	properties.TotalEditingTime = 43;
	properties.Version = 44;
		
	var saveOptions = SaveOptions.CreateSaveOptions(SaveFormat.Docx);
	saveOptions.UpdateLastSavedTimeProperty = true;
	doc.Save(@"D:\test.docx", saveOptions);
}

@owenb6eee,

Thanks for sharing the detail. You have shared the output document generated by Aspose.Words.

The BuiltInDocumentProperties.Version is related to AppVersion property in app.xml and MS Word does not allow to change it. This property represents the version number of the application that created the document. Following are the version numbers for MS Word.

11.0000 = Word 2003
12.0000 = Word 2007
14.0000 = Word 2010
15.0000 = Word 2013
16.0000 = Word 2016

You can get this value as shown below.
Console.WriteLine(doc.BuiltInDocumentProperties.Version >> 16);

If you still face problem, please manually create your expected Word document using Microsoft Word and attach it here for our reference. We will investigate how you want your final Word output be generated like. We will then provide you more information on this.

Aha I see now! I incorrectly assumed it was a document version rather than the software version.

Thanks for looking into it.

@owenb6eee,

Thanks for your feedback. It is to inform you that we have closed WORDSNET-16305 as ‘Not a bug’. Please let us know if you have any more queries.