View Single Post
 
Old 05-16-2013, 02:56 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,375
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

No, that's not how you would use Instr. You have to open both file before you can test the xml file's contents with Instr. For example, to test each image from your "ImageNames.txt" file:
Code:
Dim I As Long
With #hFile
  For I = 0 To UBound(Split(sRegImageFile, vbCr))
    If InStr(.Text, Split(sRegImageFile, vbCr)(I)) = 0 Then
      'The image name isn't present, so add it.
      'Your code to add the image goes here
    End If
  Next
End With
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote