Are there any complete code examples of how to parse a Word document?
I know the docs have references here and there, but I’m interested in a complete example that goes line by line and extracts the text, basic formatting (bold, underline, italics), etc.
Hi Akbar,
Thanks for your interest in Aspose.Words.
Sure, we have a similar example in the documentation here which uses DocumentVisitor to “visit” all the content in the the document and append it to a string. I believe this is the base method you would use to achieve what you are looking for, you could then add in some calls to the Font classes to extract the formatting. If you could share some further details we will be happy to assist you further.
Thanks,
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.