Skip navigation
Currently Being Moderated

IllustratorVBの質問で恐縮ですが……

May 21, 2008 7:35 PM

IllustratorSDKがないのでダメモトでこちらに書き込みさせていただきます。
IllustratorVBについての質問です。

Illustratorに画像が何点か貼り込まれていて、
選択している貼り込み画像のファイル名もしくはファイルパスを取得するVBを作りたいのですが、
オブジェクトライブラリにSelectionがあるのを確認して以下のように記述したのですが、

Set myIllustrator = CreateObject("Illustrator.Application.3")
MsgBox myIllustrator.ActiveDocument.Selection.File

「オブジェクトがありません」のエラーになってしまいます。

しかたなく以下のように記述するとファイルパスが取得できます。

Set myIllustrator = CreateObject("Illustrator.Application.3")
CNT = myIllustrator.ActiveDocument.PlacedItems.count
For i = 1 To CNT
if myIllustrator.ActiveDocument.PlacedItems(i).Selected = true then
MsgBox myIllustrator.ActiveDocument.PlacedItems(i).File
end if
Next

でもこのスクリプトはあまりにもひどすぎます。
もっとシンプルにファイル名もしくはファイルパスを取得するにはどのように記述すれば良いのでしょうか。
よろしくお願い致します。
  • Currently Being Moderated
    Community Member
    May 22, 2008 10:58 AM
    あてずっぽうですが、

    Set myIllustrator = CreateObject("Illustrator.Application.3")
    MsgBox myIllustrator.ActiveDocument.Selection(1).File

    ではどうですか。
    |
    Mark as:
  • Currently Being Moderated
    Community Member
    May 22, 2008 5:10 PM
    Set myIllustrator = CreateObject("Illustrator.Application.3")
    mySelect = myIllustrator.ActiveDocument.Selection
    MsgBox mySelect(0).File

    でどうですか
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)