HI @yhonsalas
This macro saves a PNG screenshot of the project's first view to a folder named "PNG_Files" automatically appending an incremental number to the filename if a file with that name already exists.
Sub SaveScreenCaptureToFile()
Dim RobApp As RobotApplication: Set RobApp = New RobotApplication
Dim filePath As String: filePath = GetFolder(RobApp.Project.FileName) & "PNG_Files\"
Dim fso As Object: Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FolderExists(filePath) Then fso.CreateFolder filePath
Dim baseName As String: baseName = "ScreenCapture"
Dim ext As String: ext = ".png"
Dim fullPath As String: fullPath = filePath & baseName & ext
Do While fso.FileExists(fullPath)
i = i + 1: fullPath = filePath & baseName & "(" & i & ")" & ext
Loop
If Not RobApp.Project.viewMngr.GetView(1).Printable.SaveToFile(fullPath, I_OFF_PNG) Then
MsgBox "Failed to save the screen capture.", vbOKOnly, "Error"
End If
Set fso = Nothing
Set RobApp = Nothing
End Sub
for more settings
Best Regards