Article View: adobe.scripting.indesign
Article #17884Re: Step and repeat... in VB?
From: Stu Bloom
Date: Sun, 11 May 2003 00:09
Date: Sun, 11 May 2003 00:09
37 lines
2334 bytes
2334 bytes
Sorry for the stupid question - I've never used Step and Repeat, so I didn't know what you were talking about.
It doesn't appear there's a built-in function. But if you use the facility a lot, you could write a generic function to give you that functionality. The following has NOT been extensively tested:
Option Explicit
Public Function StepAndRepeat(objDup As Object, nRepeatCount As Long, _
nHorizontalPoints As Single, nVerticalPoints As Single) As Boolean
Dim nRepeats As Long
Dim objDuped As Object
On Error GoTo CantStepAndRepeat
Select Case TypeName(objDup)
Case "EPS", "Group", "Image", "Line", "Oval", "PageItem", _
"PDF", "Polygon", "Rectangle", "TextFrame"
If nRepeatCount > 0 Then
For nRepeats = 1 To nRepeatCount
Set objDuped = objDup.Duplicate
objDup.Move moveTo:=Array(nHorizontalPoints * nRepeats & "pt", _
nVerticalPoints * nRepeats & "pt")
Next nRepeats
End If
StepAndRepeat = True
Case Else
' not a duplicatable object, so raise an error
' To use the information passed to the Raise method, remove
' the On Error Goto and trap the error in the caller
Err.Raise vbObjectError + 1000, "StepAndRepeat", _
"Object type cannot be duplicated"
End Select
Exit Function
CantStepAndRepeat:
StepAndRepeat = False
Exit Function
End Function
Technical Details
Message-ID:
<1de9118c.2@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!lnewspeer00.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de9118c.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,b719383c7f1db8f5 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-05-10 17:37:43 PST From: "Stu Bloom" <stu@earlvillepost.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!lnewspeer00.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: Step and repeat... in VB? Message-ID: <1de9118c.2@WebX.la2eafNXanI> Date: Sat, 10 May 2003 17:09:58 -0700 References: <1de9118c.-1@WebX.la2eafNXanI> Lines: 42 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit