How can I retrieve which styles are in the "Quick Style"-gallery

Hi,

Here at Infoland we use Aspose.Words to retrieve all the styles our customers use in a Word document.
Because this list of styles can get really long and unclear we want to limit the list so that it only displays items part of the “Quick Style” gallery.

I could not find a property on the Style class, so what I would want to know is how to get this information using Aspose.Words.

Thanks in advance for the reply,

Sjoerd van Loon
Software Engineer
Infoland BV
The Netherlands

Hi Sjoerd,
Thanks for your inquiry.
You’re correct that there is currently no way to detect this. Your request for this feature has been logged. We will inform you when this is ready.
Thanks,

Hi Adam,

Could I get an indication when this feature would be developed and released?

With kind regards,

Sjoerd van Loon
Software Engineer
Infoland BV
The Netherlands

Hi
Thanks for your request. Unfortunately, at the moment we cannot provide you a reliable estimate. Our developers should investigate and schedule the issue. We will let you know once the issue is resolved or we have more information regarding this feature.
Best regards,

Hi,
I would like to enquire if this issue has already been investigated by your developers.
With kind regards,

Sjoerd van Loon
Software Engineer
Infoland BV
The Netherlands

Hi
Thanks for your request. Unfortunately, the issue is still pending for analysis. We will keep you informed regarding status of this issue and let you know once it resolved.
Best regards,

Hi

I just found out that the QuickStyles are stored separately in the the program files and user data directories.

Source: http://compusavvy.wordpress.com/2009/11/09/where-important-word-2007-files-are-stored/

So maybe this does mean that it completely not possible to load the quick style gallery from a word document?
Because it is always required to have the referenced files present?

With kind regards,

Sjoerd van Loon
Software Engineer, Infoland BV

Hi Sjoerd,
Thanks for your inquiry.
I believe the styles in the quick style gallery are stored within the document itself e.g inside styles.xml of a DOCX document so there should still be a way to retrieve this property.
Also note that on my machine the Quick styles folder within my User account is empty.
Thanks,

Hi Adam,

Mmm, I already checked that file and the different nodes in the file.

It seems that all the possible styles are defined in the “latentStyles” node. Not especially the QuickStyles.
Each childnode / style has some attributes, but I do not see any different between a TOC style (which is not in the Quick Style Gallery) and the Book Title style (which IS in the Quick Style Gallery).

Also it seems that User Styles are also (partially?) defined in the Styles.xml in the Style nodes.

“Also note that on my machine the Quick styles folder within my User account is empty.”

According to the link in my former post only the custom quick styles are defined there (per user), the default Quick Styles should be in “Program Files\Microsoft\Office12\etc…”

But you probably know your way better around the internal workings of Word then I do, so I will believe if you say that it is possible to get the information from the styles.
I just would like to know how, because then I can maybe create a workaround as long as Aspose.Words does not yet support this feature, so I can make my functional architect happy

With kind regards,

Sjoerd van Loon
Software Engineer, Infoland BV

Hi
Thanks for your request and useful information. Actually, in DOCX documents you can mark a particular style as “important” style for the current document. You can do this by setting qFormat property. In this case, style is treated as particularly important for the current document, and this information is used by MS Word. Such styles are usually displayed in “Quick Styles” gallery.
So, if you need to show some style in “Quick Styles” gallery, you need to do the following:

  1. Remove qFormat option from all styles defined in the document.
  2. Set this option only for styles that you would like to see in “Quick Styles” gallery, just like shown below:
<w:style w:type="paragraph" w:customStyle="1" w:styleId="Style1">
	<w:name w:val="Style1" />
	<w:basedOn w:val="Normal" />
	<w:qFormat />
	<w:link w:val="Style1Char" />
	<w:rsid w:val="004E5B87" />
	<w:rPr>
		<w:b />
		<w:bCs />
	</w:rPr>
</w:style>

Hope this helps you to achieve what you need.
But you should note that qFormat option can be omitted, in this case all styles are treated as usual styles and “Quick Styles” gallery is filled by “important” styles defined in template attached to the current document or in the default template.
Best regards,

Hi Alexey,

Thank you for the information. It seems you’ve found another piece of the puzzle.
Only it is not required to set the QuickStyle gallery of a document, but to read the QuickStyle gallery.

If I understand correctly it comes down to this: when document has the qFormat properties on its styles something could be made to read all the styles with that property set to get all the styles from the QuickStyle gallery.
But if the qFormat properties have been completely ommited something (new?) has to be created to combine the default template and current document styles to know which styles are quick styles?

With kind regards,

Sjoerd van Loon
Software Engineer, Infoland BV

Hi
Thanks for your request. Yes, you understand correctly. Part of styles displayed in the “Quick Styles” gallery is from the current document and other part is from the template linked to this document.
For example, in the original document there are three styles with qFormat property set and in the template there are seven styles with qFormat property set. If you open your document in MS Word, you will see 10 styles in the “Quick Styles” gallery. First three will be from the current document and other from the template.
Best regards,

Hi,

Context: your example
So if I understand it correctly it would be possible (for Aspose.Words in the long run) to get the three qFormat styles (their names and properties).
But it will not be possible to get the seven other styles because they are stored on the client’s computer?

With kind regards,

Sjoerd van Loon,
Software Engineer, Infoland BV

Hi
Thanks for your request. Yes, it is possible to retrieve styles with qFormat attribute from the particular document. But eventually list of styles that appears in “Quick Styles” gallery also depends on styles defined in templates on the end-user’s PC.
Best regards,

The issues you have found earlier (filed as WORDSNET-4252) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.

The issues you have found earlier (filed as WORDSNET-4252) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(1)

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan