🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #18783

How do I - change the paragraph style in a cell? (VB)

#18783
From: Iolaire McFadden
Date: Tue, 04 Mar 2003 21:53
28 lines
1964 bytes
I'm placing text into a table cell via Visual Basic and would like to change the paragraph style at the same time but can not figure it out. Any suggestions?

      Public myInDesign As InDesign.Application Public myDocument As InDesign.Document
      Public myTable As InDesign.Table
      Sub put_data_in_table()
      Set myInDesign = CreateObject("InDesign.Application.2.0")
      Set myDocument = myInDesign.Open("C:\Template.indd")
      Rem I have a text frame built to hold my new table so I can modify the
      table to fit the frame
      Set myholdingart = myDocument.TextFrames.Item("Markets_and_Submarkets_Box")
      Set myTable = myholdingart.ParentStory.Tables.Add
      Set myTable = myTable.Parent.ApplyStyle("Mehtodology Text")
      myTable.ColumnCount = 2
      myTable.Columns.Item(1).Width = "2 in"
      myTable.Columns.Item(2).Width = "4.75 in"
      Set myinsertionpoint = myTable.Rows.Item(1).Cells.Item(1).InsertionPoints.Item(-1)
      REM --------- this style line doesn't work
      myinsertionpoint.ApplyStyle = myDocument.ParaStyles.Item("footer")
      REM --------- end bad code
      myinsertionpoint.TextContents = "Some random copy in this cell"
      End Sub





Thanks in advance,
iolaire
Technical Details
Message-ID: <1de82385.-1@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newsfeeds.sol.net!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,9cd82a40aca77ebf,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-03-04 14:08:05 PST
From: "Iolaire McFadden" <imcfadden@costar.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newsfeeds.sol.net!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: How do I - change the paragraph style in a cell? (VB)
Message-ID: <1de82385.-1@WebX.la2eafNXanI>
Date: Tue, 4 Mar 2003 13:53:14 -0800
Lines: 29
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit