TPE

http://bayanbox.ir/view/263405954590585756/2mobile.png

Tavvafi@gmail.com


≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡

Sub Play()
   With ActiveWindow.Selection
      If .HasChildShapeRange Then
         Debug.Print "Yes"
      Else
         Debug.Print "No"
      End If
      If .HasChildShapeRange = True Then
         Debug.Print "Yes"
      Else
         Debug.Print "No"
      End If
      If .HasChildShapeRange = False Then
         Debug.Print "No"
      Else
         Debug.Print "Yes"
      End If
      If Not .HasChildShapeRange Then
         Debug.Print "No"
      Else
         Debug.Print "Yes"
      End If
   End With
End Sub

HasChildShapeRange = true  --> expected output:

Yes, Yes, No, No

actual output:

Yes, No, Yes, No

expression:

If .HasChildShapeRange = True Then

evaluates as false because 1 is not equal to -1 (the value of True).

expression:

If Not .HasChildShapeRange Then 

If .HasChildShapeRange Then

expression = True.

If .HasChildShapeRange = False Then