我有Powerpoint演示文稿。在每張幻燈片上,我都有8個帶文字空間的形狀。它們可以包含表示與內容/數據更新等有關的組的文本。 我有以下其中包含用戶對那些責任區陣列:使用字符串引用vba中的數組名稱
GEN = Array("username_01","username_02","username_03",..."username_xx")
POL = Array("username_01","username_02","username_03",..."username_xx")
B2B = Array("username_01","username_02","username_03",..."username_xx")
RUS = Array("username_01","username_02","username_03",..."username_xx")
而這個功能,如果用戶是在陣列中,檢查
Function IsInArray(stringToBeFound As Variant, arr As Variant) As Boolean
IsInArray = (UBound(Filter(arr, stringToBeFound)) > -1)
End Function
我的問題是,當我想使用的功能,它只有工作,如果我給下面的數組名稱:
auser = Environ("UserName")
IsInArray(auser,GEN) 'it will give me answer if the user is in array
我想形狀的文字:
res_group_txt = ActivePresentation.Slides(i).Shapes(shape_owner).TextEffect.Text
並把它莫名其妙地在一個函數,所以它不會返回一個錯誤
auser = Environ("UserName")
IsInArray(auser,res_group_txt)
我曾試圖改變變量,並通過所有的主題看,但我還沒有找到答案:(
幫助請:)
BR Misza
你有沒有試圖改變的參數CompareMethod.Text或CompareMethod.binary的過濾器函數? – Lowpar