search

  • Thread starter Thread starter TRM
  • Start date Start date
T

TRM

Function DetPath(strDoc As Variant) As String

Dim strSearchFor As String
Dim intSearchFound As Integer
Dim strPath As String
Does anyone know why the "intSearchFound" might sometimes
come up with a number >0 when the string ("W ") does not
exist? It just seems to happen sporadically. Other
resources?

Dim strDir As String
intSearchFound = 0

'this group of statements checks to see if the new
document is a work intruction to determine the path
strSearchFor = "W "
intSearchFound = InStr(1, strDoc, strSearchFor,
vbTextCompare)
If intSearchFound > 0 Then
DetPath = "WorkIns\"
Else
DetPath = "drafts\"
End If

End Function
 
Sorry! I found this, apparently I skimmed through the
parameters rather quickly! I want to test for the
specified string being only in the 1st position!
 
Back
Top