Do you do it by macro command? Then the command will have empty output.
Public Function OpenImage() As SimpleScript
OpenImage = New SimpleScript
Dim docList1 = New List(1), doc1
With Application.DocumentCommands.OpenImage(OpenImage)
.Filenames = Nothing'user prompt
.Run(docList1)
End With
If docList1 Is Nothing Then
Exit Function'user canceled open
End If
With Application.DocumentCommands.Activate(OpenImage)
.Run(docList1(0), doc1)
End With
End Function
Answers
Public Function OpenImage() As SimpleScript OpenImage = New SimpleScript Dim docList1 = New List(1), doc1 With Application.DocumentCommands.OpenImage(OpenImage) .Filenames = Nothing'user prompt .Run(docList1) End With If docList1 Is Nothing Then Exit Function'user canceled open End If With Application.DocumentCommands.Activate(OpenImage) .Run(docList1(0), doc1) End With End Function
Yuri
I have just solved my own problem. All I needed was to check the number of documents