Visual Studio example

In the hope this will be helpful to another beginner, here’s the code for the VS example (modified for my system and files and taken from the English-language developer’s guide) executed on VS Community Edition 2019 v16.7.1. This version does not use ‘MiTools’ (stay tuned :grinning:).

N.B. There is nothing in here that is not available in the documentation, but perhaps this will offer one more way to access the information.

Prerequisites:
Create a WinForms app (a console app would probably work as well, see the code with commented-out references for WinForms apps).
Install the VSIX extension for RPA Suite for Visual Studio:

Add a reference to the Cartes library from the COM tab:

Code:

using System;
// using System.Collections.Generic;
using System.IO;
// using System.Linq;
using System.Reflection;
// using System.Threading.Tasks;
// using System.Windows.Forms;
using Cartes;
namespace Rigel1
{
	static class Program
	{
		[STAThread]
		static void Main()
		{
			CartesObj cartes = new CartesObj();
			RPAWin32Component notepad = null;
			cartes.open(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), 
				@"C:\Users\HP6300\Documents\RPA Developer\Projects\FirstApe.rpa"));
			cartes.Execute("visualmode(1);"); 
			notepad = (RPAWin32Component)cartes.component("$Notepad");
			if (notepad.componentexist(0) == 0)
			{
				cartes.run("notepad.exe");
				notepad.waitforcomponent(15);
				cartes.reset(notepad.api());
            }
			notepad.focus();
			notepad.Value = "Hello world";
		}
	}
}

A (rather poor) animated GIF of running the project in VS:

Imgur

Regards,
burque505