StyleSheetItemMetadata CloneStyleSheetItem(string mon)
mon. Moniker of single style in styles table.
The CloneStyleSheetItem operation creates a style clone in styles table.
To execute the operation, in the mon field specify moniker of opened styles table instance with the !<style number> postfix. The moniker can be obtained on executing the OpenStyleSheet operation.
The operation results in the metadata of created style clone.
Below is the example of creating a style clone in styles table. The request contains style moniker. The response contains information about the created style.
{
"CloneStyleSheetItem" :
{
"mon" : "CPDKLBGLHHOOFOAEEOBMIPONHEFJBEBEOLJEMAEIDCPLAAGC!M!S!SDJNKBJGLHHOOFOAENACKGIKGBKMHOKOEOJBIKCBEOKJJAPGE!2"
}
}
{
"CloneStyleSheetItemResult" :
{
"h" :
{
"key" : "3",
"tag" : "TAB",
"name" : "Style1 (copy 1)",
"id" : "I3"
},
"style" :
{
"@UNS" : "2",
"Text" :
{
"@VA" : "-1",
"@Mmm" : "-1.00 -1.00 -1.00 -1.00",
"@HA" : "-1",
"@WW" : "-1"
},
"Font" :
{
"@S" : "12",
"@F" : "Arial",
"@H" : "18",
"@I" : "true"
},
"Borders" : "",
"Hyperlink" : "",
"ContainerInfo" :
{
"@key" : "3",
"@sheetType" : "0"
}
}
}
}
public static StyleSheetItemMetadata CloneStyleSheetItem(string moniker, ulong styleNumber)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tClone = new CloneStyleSheetItem()
{
mon = moniker + '!' + styleNumber
};
// Clone style
var result = somClient.CloneStyleSheetItem(tClone);
return result;
}
See also: