Skip to main content
Participant
February 7, 2023
Question

How to get dialog content with COM Interop?

  • February 7, 2023
  • 0 replies
  • 164 views

I'm using a COM Object to open an EPS file, which was created by a newer version of Illustrator than the one I'm using. I want to get the content of Dialogs similar to this to save, how do I do it.

 

using Illustrator;
using System;

internal class Program
{
    private static void Main(string[] args)
    {

        Application app = GetIllustrator();

        Console.WriteLine("open file");

        Document doc = app.Open("Z:\\greater-than-current-version.eps");
        
        Console.WriteLine("open done");
    }

    private static Application GetIllustrator()
    {
        while (true)
        {
            try {
                Application app = new()
                {
                    //UserInteractionLevel = AiUserInteractionLevel.aiDisplayAlerts

                };

                return app;
            } catch (COMException e) {
                Thread.Sleep(500);
            }
        }
    }
}

 

This topic is closed to new replies. Start a new post to keep the conversation going.