T
TM
Hi,
I need some help...
I trying to write some VBA code to detect a file extention and I'm stuck
I've used the split function to put everything in an array. But how can I
get to the last value of my array ?
Can anyone please help me ?
## START
Dim strName As String
Dim strType As String
Dim strWords() As String
Dim intWordsAantal As Integer
With Dialogs(wdDialogInsertPicture)
If .Display Then
strName = WordBasic.FilenameInfo$(.Name, 1)
End If
End With
strWords = Split(strName, ".")
intWordsAantal = 0
For Each Item In strWords
intWordsAantal = intWordsAantal + 1
Next
strType = strWords(intWordsAantal ) ' DOES NOT WORK
## END
Kind regards,
TM
I need some help...
I trying to write some VBA code to detect a file extention and I'm stuck
I've used the split function to put everything in an array. But how can I
get to the last value of my array ?
Can anyone please help me ?
## START
Dim strName As String
Dim strType As String
Dim strWords() As String
Dim intWordsAantal As Integer
With Dialogs(wdDialogInsertPicture)
If .Display Then
strName = WordBasic.FilenameInfo$(.Name, 1)
End If
End With
strWords = Split(strName, ".")
intWordsAantal = 0
For Each Item In strWords
intWordsAantal = intWordsAantal + 1
Next
strType = strWords(intWordsAantal ) ' DOES NOT WORK
## END
Kind regards,
TM