🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #8339

Get the widest word in a story? VB, CS1

#8339
From: Brian_C._Carter
Date: Wed, 18 Oct 2006 17:09
7 lines
1201 bytes
Is there any simple way to find out the longest word in a story?

The way I do it now is to loop through the Words collection and for each word get the start horizontal offset and the end horizontal offset and do the math and then compare to my previous largest value and if it's larger, make that the largest value and then go on.

All doable but it feels clunky and clumsy. Right now I look for the widest word, but looking for the longest would also be a big help (I know that's somewhat simpler by getting the count of each character, but that only saves a few lines) if it's just a matter of saying asking for it.

I'm using VB & CS 1.
Technical Details
Message-ID: <3bc20295.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,22533d59e2f54e83,start
X-Google-Attributes: gidf939a,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Brian_C._Carter@adobeforums.com
Newsgroups: adobe.scripting.indesign
Subject: Get the widest word in a story? VB, CS1
Message-ID: <3bc20295.-1@webcrossing.la2eafNXanI>
Date: Wed, 18 Oct 2006 10:09:29 -0700
Lines: 13
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossing