We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

DocumentBuilder Write or DocumentBuilder Writeln is not writing to file

I am trying to write some content in words file

SharedPtr<Document> doc = System::MakeObject<Document>();
SharedPtr<DocumentBuilder> builder = MakeObject<DocumentBuilder>();
System::String protected_file_path(filePath);
System::String shadow_file_path(src_directory_path + fileName);

when I open the file, it does not have anything in it. I tried writing some property values like author, it was reflecting those details.
I am using msoffice 2021 professional

@deepanshugarg09 You should pass Document object into the DocumentBuilder constructor:

System::SharedPtr<Document> doc = System::MakeObject<Document>();
System::SharedPtr<DocumentBuilder> builder = System::MakeObject<DocumentBuilder>(doc);