🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #17513

Re: A simple footnote model

#17513
From: Guy Verville
Date: Sat, 31 May 2003 22:09
52 lines
2873 bytes
Again me.

Cycling through pages remove the previous problem. Now, I must find a way to taking into account the relative positions of the foonotes call if, for example, they are made from numerous text frames.

Sub RenumberFootnotesIndesign()
    Dim i, j, k, starteur, starteur2 As Integer
    Const AppelNote = "AppelNote"
    Const ChiffreNote = "ChiffreNote"
    Dim test, test1 As Variant
    Set myindesign = CreateObject("InDesign.Application.2.0")
    Set mydoc = myindesign.ActiveDocument
    ' clears find preferences
    myindesign.FindPreferences = idNothing
    myindesign.ChangePreferences = idNothing

' checks if "AppelNote" or "ChiffreNote" exists. AppelNote is the name of the characteur style
    ' I use to place my footnote number in text
     If mydoc.CharStyles.Count > 0 Then
        For i = 1 To mydoc.CharStyles.Count
            Select Case mydoc.CharStyles.Item(i)
                Case Is = AppelNote: j = 1
                Case Is = ChiffreNote: k = 1
            End Select
        Next i
    End If
    If j = 0 Or k = 0 Then MsgBox "Please make sure you have the necessary CharacterStyle set in your pub.": End

'Loops through the pages
    For k = 1 To mydoc.Pages.Count
        Set mypage = mydoc.Pages.Item(k)
        ' Loops the Textframes
        For j = 1 To mypage.TextFrames.Count
            Set myTSRs = mypage.TextFrames.Item(j).TextStyleRanges
            ' Loops through the TextStyleRanges
            For i = 1 To myTSRs.Count
                'Finds "AppelNote" and "ChiffreNote"
                With myTSRs.Item(i)
                    'test = .CharacterStyle
                    Select Case .CharacterStyle
                        Case Is = AppelNote
                            starteur = starteur + 1
                            .TextContents = LTrim$(starteur)
                        Case Is = ChiffreNote
                            starteur2 = starteur2 + 1
                            .TextContents = LTrim$(starteur2)
                    End Select
                End With
            Next i
        Next j
    Next k
    MsgBox "Finish"
End Sub
Technical Details
Message-ID: <1de95549.4@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de95549.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,aa16bd12e0e1253e
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-05-31 15:37:46 PST
From: "Guy Verville" <taddeus@spamcop.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: A simple footnote model
Message-ID: <1de95549.4@WebX.la2eafNXanI>
Date: Sat, 31 May 2003 15:09:20 -0700
References: <1de95549.-1@WebX.la2eafNXanI>
Lines: 56
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit