1、可以试试用数组实现
Dim i as Integer
Dim arr() As String
Redim arr(4)
arr(0)="image0"
arr(1)="image1"
arr(2)="image2"
arr(3)="image3"
arr(4)="image4"
for i = 0 to 4
...
Result = ListViewVP (CompareImage, "ObjectIndex=1", "VP=" + strName )
或
Result = ListViewVP (CompareImage, "ObjectIndex=1", "VP=" + "+strName+" )
...
next
2、上面的方法是定义的数组,也可以不定义数组,试试这样写是否可以
Result = ListViewVP (CompareImage, "ObjectIndex=1", "VP=image" + i )
我现在没有环境,没有测试,仅供参考。