Selasa, 16 Juni 2020

[MSAccessProfessionals] Shell command to move files

Hello all,
I am trying to use vba to move some files from a local folder to a network drive folder. I am able to use a shell command to move certain files over with an explicit name such as below and it works perfect.
Call Shell("CMD /C MOVE C:\DirectReports\FMExecDirSummary.PDF U:\TestTemp3\")

I have a process that outputs the reports to a folder and then emails the pdf attachment as it loops through the recordset. But I would like to move the pdf's to a network folder for review.

But I have a number of files that have spaces, with a specific name at the end and the shell command does not work with spaces in the name of the file.
for example the below does not work. because there are many reports with the name of the person at the end, i am trying to move any file with the beginning Accruals Report By Reports To -
Call Shell("CMD /C MOVE C:\DirectReports\Accrual Report By Reports To -*.PDF U:\TestTemp\")

Is there a way to get this to work without changing the name of the report to have no spaces?

Thank You
Jim Wagner
_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#115608) | Reply To Group | Reply To Sender | Mute This Topic | New Topic

Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Tidak ada komentar:

Posting Komentar