Programm code is not executed
A batch process loads an image, create a thumbnail from it and finally export it (Button: Create and Export Thumbnail). I would like to override the output path and additional settings via program code. If I integrate the method SaveImageAsThumbnail, generally no program code will be executed. If I comment out the program code between the comments "from here" "to here" with "'", no program code will be executed either. Only when I remove the program code will the program run again.
Public Sub SaveImageAsThumbnail
    Dim newSaveFileName As String
    Dim window1, doc1, varList1
    newSaveFileName = "C:\temp\Thumbnail.png"
    With MediaCy.Automation.Application.WindowCommands.Active(Nothing)
        .Run(window1)
    End With
    With MediaCy.Automation.Application.DocumentCommands.Activate(Nothing)
        .Run(window1, doc1)
    End With
    ' from here
    With MediaCy.Automation.Application.ApplicationCommands.SetOption(Nothing)
        .Module = "QuickSave"
        .Section = "Publication"
        .Key = "Extension"
        .Value = "PNG"
        .Run()
    End With
    With MediaCy.Automation.Application.ApplicationCommands.SetOption(Nothing)
        .Module = "QuickSave"
        .Section = "Publication"
        .Key = "Reopen"
        .Value = False
        .Run()
    End With
    With MediaCy.Automation.Application.ApplicationCommands.SetOption(Nothing)
        .Module = "QuickSave"
        .Section = "Publication"
        .Key = "UseCurrentZoom"
        .Value = False
        .Run()
    End With
    With MediaCy.Automation.Application.ApplicationCommands.SetOption(Nothing)
        .Module = "QuickSave"
        .Key = "PlaySound"
        .Value = False
        .Run()
    End With
    With MediaCy.Automation.Application.ApplicationCommands.SetOption(Nothing)
        .Module = "QuickSave"
        .Section = "Publication"
        .Key = "ImageSize"
        .Value = 1000
        .Run()
    End With
    With MediaCy.Automation.Application.ApplicationCommands.SetOption(Nothing)
        .Module = "QuickSave"
        .Section = "Publication"
        .Key = "Path"
        .Value = newSaveFileName
        .Run()
    End With
    ' to here
    With MediaCy.Automation.Application.WindowCommands.QuickSaveSelectedForPublication(Nothing)
        .Run(varList1)
    End With
End Sub
I have attached a sample project. What can I do? How can I solve this?
Thanks in advance
fsup
                0
            Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions
