deleting character in xml file

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top