Skip to main content
May 9, 2016
Question

Clear paragraph style override

  • May 9, 2016
  • 3 replies
  • 1455 views

Hello All

I am trying to clear override of a paragraph style by reapplying the para style on the same paragraph

But its not clearing the override

My Code:

oObj.appliedparagraphstyle = oObj.appliedparagraphstyle

Where is it going wrong?

Please suggest

Thank you

This topic has been closed for replies.

3 replies

karthikS
Inspiring
May 9, 2016

Hi aviR

Try this one

app.selection[0].parentStory.clearOverrides();

alert("Clear Overrides")

Thanks

May 9, 2016

Hey karthik

Thanks for your quick reply.

But I cant work on selected object . So i have to go through AppliedParagraphStyle.

so is there any other way?

tpk1982
Legend
May 9, 2016

is the para style in style group?

May 9, 2016

No that is individual paragraph style

tpk1982
Legend
May 9, 2016

Could you please share the coding? Is it jS or VB?

Loic.Aigon
Legend
May 9, 2016

Hi

You may choose to either clear overrides from the text object:

void clearOverrides ([overridesToClear: OverrideType=OverrideType.ALL])
Clears the specified types of override.

ParameterTypeDescription
overridesToClearOverrideType:
OverrideType.ALL
OverrideType.CHARACTER_ONLY
OverrideType.PARAGRAPH_ONLY
The types of override to clear. (Optional) (default: OverrideType.ALL)

or

use:

void applyParagraphStyle (using: ParagraphStyle[, clearingOverrides: bool=true])
Apply a paragraph style.

ParameterTypeDescription
usingParagraphStyleThe paragraph style to apply.
clearingOverridesboolIf true, clear any text attributes before applying the style. (Optional) (default: true)

FWIW

Loic

Ozalto | Productivity Oriented - Loïc Aigon