L
Laura
I’m trying to make a macro in access that looks in a specific directory if
the number of pdf files is greater than 1. In this case, I have to open the
..xml document, that is placed in another directory, and delete the last
character (and close the document).
I don´t know how to access the last position (ok, with the EOF() function,
but I don’t know how to delete easyly (like in word))
Do you know if there is any fast-method to delete this?
Thank you!!
With Application.FileSearch
.FileName = "*.pdf"
.LookIn = "C:\OUT\WP51\" & directorio & "PDF"
.SearchSubFolders = True
.Execute
If .FoundFiles.Count > 1 Then
MsgBox ("nº of found documents more than one")
Dim nom As String
With Application.FileSearch
.FileName = "*.xml"
.LookIn = "C:\OUT\WP51\" & directorio & ""
.SearchSubFolders = False
.Execute
If .FoundFiles.Count > 0 Then
nom = .FoundFiles.Item(1)
Open nom For Random As #2
MsgBox ("document open")
'???
Close #1
Else
MsgBox ("the xml file doesn’t exist")
End If
End With
Else
MsgBox ("Nº of documents less than one")
End If
End With
the number of pdf files is greater than 1. In this case, I have to open the
..xml document, that is placed in another directory, and delete the last
character (and close the document).
I don´t know how to access the last position (ok, with the EOF() function,
but I don’t know how to delete easyly (like in word))
Do you know if there is any fast-method to delete this?
Thank you!!
With Application.FileSearch
.FileName = "*.pdf"
.LookIn = "C:\OUT\WP51\" & directorio & "PDF"
.SearchSubFolders = True
.Execute
If .FoundFiles.Count > 1 Then
MsgBox ("nº of found documents more than one")
Dim nom As String
With Application.FileSearch
.FileName = "*.xml"
.LookIn = "C:\OUT\WP51\" & directorio & ""
.SearchSubFolders = False
.Execute
If .FoundFiles.Count > 0 Then
nom = .FoundFiles.Item(1)
Open nom For Random As #2
MsgBox ("document open")
'???
Close #1
Else
MsgBox ("the xml file doesn’t exist")
End If
End With
Else
MsgBox ("Nº of documents less than one")
End If
End With