Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Applying TableStyle to an XML-table

Status
Not open for further replies.

nesplb

Programmer
Jul 29, 2003
109
0
0
NO
Hi!

I'm using XML Rules in Indesign CS3 to find every table element in an xml file in Indesign. (The tables are imported as CALS and looks just like normal Indesign tables in the layout) I find the table element but when I try to attach a TableStyle "table" nothing happens. Does anyone know what im doing wrong? I know that I find the tables because the text "TEST" is inserted after each table.
here's my code:

Public Property Get name()
name = "ProcessDevice"
End Property
'XPath
Public Property Get xpath()
xpath = "//Table"
End Property
Public Function apply(myXMLElement, myRuleProcessor)
With myXMLElement
.InsertTextAsContent "TEST",InDesign.idXMLElementPosition.idAfterElement
.ApplyParagraphStyle ("table")
End With
apply = False
End Function

In advance thanks!

Pål Nesteby

PDC-Tangen
Norway
 
Sorry!

I made an error:

The line
.ApplyParagraphStyle("table")
should ofcourse be:
.ApplyTableStyle ("table")

-And it still dont work....




Pål Nesteby

PDC-Tangen
Norway
 
I found the solution!

With myXMLElement
.Tables(1).AppliedTableStyle = "table"
End With

This because it's not the xml element it self that shall have the table style, but the table of the XML-element Table.



Pål Nesteby

PDC-Tangen
Norway
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top