🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #17142

Re: [VB] Place a table into an existing text frame

#17142
From: Jens Schulze
Date: Tue, 08 Jul 2003 07:10
40 lines
2738 bytes
"roberto soto" wrote:

> If you post all code lines (these that are involved with this behavior) I
can take
> a look of your code here, can be a very small thing.

Yes, know this "1 hour trial and error but only a missing character errors",
so here it is:

Public Sub FillTableInTextFrame(thisActualPage As Variant, ExcelFileName As
String, TextFrameName As String, SmartStyle As String)
    ' thisActualPage is the page to work on
    ' ExcelFileName is the name of the excel file to be placed
    ' TextFrameName is the name of the frame where the file has to be placed
    ' SmartStyle is the name of the asset to be used for formatting
    Dim thisFrame As InDesign.TextFrame
    Dim test As Variant
    If fso.FileExists(ExcelFileName) = True Then
        Set thisFrame = thisActualPage.TextFrames.Item(TextFrameName)
        thisFrame.ContentType = idText      ' make sure the frame will be a
text frame
        Call thisFrame.Place(FileName:=ExcelFileName, autoFlow:=False,
importOptions:=False, retainFormat:=False, convertQuotes:=True)
        ' here you can find the part that uses the smartstyles plugin to
format the tables
        Set myID = thisActualPage.Parent.Parent.Parent    ' take the
application object
        Dim thisLib As InDesign.Library
        Set thisLib = myID.Libraries.Item(1)
        Dim thisAssets As InDesign.Assets
        Set thisAssets = thisLib.Assets
        Dim thisAsset As InDesign.Asset
        Set thisAsset = thisAssets.Item(SmartStyle)  ' get the specific lib
asset to format the table
        thisAsset.ApplySmartStyleTo thisFrame
    End If
End Sub


Jens
Technical Details
Message-ID: <F1C696BC686FEF702D1654F75F4B3AA6@in.WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <B168702BCBE08F688C899999895B874C@in.WebX.la2eafNXanI> <1de9d0a8.2@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,41f382ef5b66028c
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-07-08 00:37:42 PST
From: "Jens Schulze" <adobeforums@trickbetrueger.org>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: [VB] Place a table into an existing text frame
Message-ID: <F1C696BC686FEF702D1654F75F4B3AA6@in.WebX.la2eafNXanI>
Date: Tue, 8 Jul 2003 00:10:39 -0700
References: <B168702BCBE08F688C899999895B874C@in.WebX.la2eafNXanI> <1de9d0a8.2@WebX.la2eafNXanI>
Lines: 42
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit