🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #19593

VB InDesign Selection Frustration

#19593
From: scottsa
Date: Sun, 01 Dec 2002 21:03
34 lines
2117 bytes
Hello All,

After finding several examples (some conflicting) I have run into an extremely frustrating situation.

I prefer to code with declared variables (Option Explicit), it usually makes debugging much easier. However, with in trying to select a labeled object, I'm running into some nasty problems.

If I declare an application object like "Dim myApp as InDesign.Application" I immediately get a type mismatch error when I try myApp.select. I also, cannot seem to declare a selection object i.e. "Dim objSelection as InDesign.Selection"

Here is a sample snippet of some test code I have - before declaring variables.

Set objIDApp = GetObject("", "InDesign.Application")
    Set objCurDoc = objIDApp.Documents.Add
    Set objCurPage = objCurDoc.Pages.Item(1)

Set objTextFrame = objCurPage.TextFrames.Add
    objTextFrame.GeometricBounds = Array(0, 0, 20, 30)
    objTextFrame.TextContents = "one"
    objTextFrame.Label = "one"

Set objTextFrame = objCurPage.TextFrames.Add
    objTextFrame.GeometricBounds = Array(20, 0, 40, 30)
    objTextFrame.TextContents = "two"
    objTextFrame.Label = "two"

Set objSelection = objIDApp.Selection
    objSelection = objIDApp.Select (objCurDoc.TextFrames.Item("one"))

After I try to declare the application, even without "Option Explicit", I get a type mismatch error.

Any thoughts?

Thanks,

Scott
Technical Details
Message-ID: <1de6d2f7.-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-04!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!proxad.net!proxad.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,b5829e63ab908ff4,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2002-12-01 13:07:38 PST
From: scottsa <scott@rscorp.ab.ca>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!proxad.net!proxad.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: VB InDesign Selection Frustration
Message-ID: <1de6d2f7.-1@WebX.la2eafNXanI>
Date: Sun, 1 Dec 2002 13:03:32 -0800
Lines: 42
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit