Article View: adobe.scripting.indesign
Article #17340[VB]Grouping Images and Text
From: B Holt
Date: Thu, 19 Jun 2003 22:08
Date: Thu, 19 Jun 2003 22:08
44 lines
1922 bytes
1922 bytes
What I want to do is have the script place a text frame and an image on the page and then group them together.
I can't see to get this to work though, here is my code:
------------------------------
Form1.MousePointer = vbHourglass
Dim myInDesign As InDesign.Application
Dim myGroup As InDesign.Group
Dim myLayerData As InDesign.Layer
Set myInDesign = CreateObject("InDesign.Application.2.0")
Set myDocument = myInDesign.Documents.Add
Set myPage = myDocument.Pages.Item(1)
Set myLayers = myDocument.Layers
Set myLayerData = myLayers.Add
myLayerData.Name = "Data"
Set myFont = myInDesign.Fonts.Item("Arial")
Set myTextFrame = myDocument.Pages.Item(1).TextFrames.Add
myTextFrame.GeometricBounds = Array(10, 10, 50, 50)
myTextFrame.TextContents = "TEXT HERE"
Set myParagraph = myTextFrame.Paragraphs.Item(1)
myParagraph.AppliedFont = myFont
myParagraph.PointSize = 14
myParagraph.Justification = idLeft
Set myWindow = myInDesign.ActiveWindow
Set mySpread = myWindow.ActiveSpread
Set myImage = mySpread.Place("IMAGE ADDRESS")
Set myGroup = myPage.Groups.Add(myLayerData, Array(myTextFrame, myImage))
Form1.MousePointer = vbDefault
------------------------------
Any help would be appriciated, thanks!
Technical Details
Message-ID:
<1de99c10.-1@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!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebXShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,d43e3c95db39f56e,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-06-19 15:38:19 PST From: "B Holt" <holtwj@mcmaster.ca> 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!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: [VB]Grouping Images and Text Message-ID: <1de99c10.-1@WebX.la2eafNXanI> Date: Thu, 19 Jun 2003 15:08:54 -0700 Lines: 46 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit