🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #16152

[VB]Programmatically change a Character color of Paragraphstyle at Runtime

#16152
From: Sean_S_D
Date: Fri, 03 Oct 2003 22:15
18 lines
2134 bytes
I'm trying to change the FillColor property (from Black to Paper therefore invisible on the document) of the ParaStyles object in various TextFrames at runtime and not having any luck. In the InDesign Scripting guide I have seen that the ParaStyles property of the Application object is read only. Is there a workaround to be able to change the FillColor setting at runtime or just deleting the actual text of that Parastyle on the document(in this instance a Parastyle named "UniqueKey"). I've tried a few different variations of code and I can read (a Debug.Print statement in the Immediate Window of Word's VBA editor) what the current setting is but not change it. I'm completely new to InDesign. I have a feeling that either I'm real close to it or it's not possible, since the InDesign documentation states ParaStyles as being read-only.

Set myID = CreateObject("InDesign.Application.2.0")
Set myDoc = myID.ActiveDocument ''Opens a library

'version 1
myID.FindPreferences = idNothing
myID.ChangePreferences = idNothing
Set myID.ParaStyles.Item("UniqueKey").ChangePreferences.FillColor = myDoc.ParagraphStyle.Item("UniqueKey").FillColor("Paper")
'version 2
Set myColor = myDoc.ParaStyles.Add
Set myColor = myDoc.ParaStyles.Item("UniqueKey").FillColor("Paper")
myDoc.ParaStyles.Item("UniqueKey").FillColor = myColor

I'm using InDesign 2.0.2 and Win2K Pro and Word's VBA editor

Thanks for any help,
Sean
Technical Details
Message-ID: <2ccda33b.-1@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!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,b3edf2ae80bd2a6b,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-10-03 15:38:13 PST
From: Sean_S_D@adobeforums.com
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.scripting.indesign
Subject: [VB]Programmatically change a Character color of Paragraphstyle at Runtime
Message-ID: <2ccda33b.-1@webx.la2eafNXanI>
Date: Fri, 3 Oct 2003 15:15:27 -0700
Lines: 30
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit