Consulting

Results 1 to 6 of 6

Thread: Taming Illustrator CS

  1. #1

    Taming Illustrator CS

    Hi all,

    I hope someone else on the planet has used Illustrator VBA before....

    I have been using a Word macro to obtain diagrams from Illustrator for insertion into Word. The actual macro works fine, but(!), when a visible instance of Illustrator is already open the screen focus switches to Illustrator when a document is openned or manipulated which slows the code down considerably.

    I have tried using LockWindowUpdate, SendMessage and ShowWindow APIs without much luck. I think some of these don't work because Illustrator has many windows as sub menus.

    Any suggestions/sympathy would be appreciated.

    Cheers,
    Andrew

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    I don't have Illustrator to check this, but can you use GetObject to try and get the Illustrator application. If it isn't open there will be an error so use On Error Resume Next. If it exists try to set the Visible property to False.

  3. #3
    Hi,

    Thanks for the quick reply! I can access Illustrator and perform all the necessary copying and pasting functions without a problem. It is the fact that the screen focus swaps to Illustrator (much like Word does when you run a macro from Excel with the visible property set to true) that slows the process down.

    Unfortunately Illustrator does not have a visible property.

    Cheers,

    Andrew

  4. #4
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    How about this. Check if Illustrator is open. If it is not just run the macro, but if it is open pop up a Message Box stating that the user should close Illustrator or the macro will run slow. If they want to run the macro anyways then run it otherwise quit based on the result from the YesNo Message Box.

  5. #5
    Yeah, I might have to do that. Actually, it may be better to use an API to totally hide the window (rather than try stopping windows switching to Ill or stopping the Ill window updating) while the code is running and then display it again when it has finished. The Ill taskbar icon will disappear and reappear, but it is the lesser of two evils.

    Thanks for your suggestion.

  6. #6
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    You're Welcome

    Take Care

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •