Can I do this?

E

Eric

Can I look to see what the first three letters/numbers are
in a file name, then based on that, save to a particular
directory? Like:

If the file name starts with the letters CAR Then save to
C:\Whatever?

If so, how? I am a inexperienced VBA programmer.
 
D

Dave Lett

Hi Eric,

You can probably use something like the following:

If Left(LCase(ActiveDocument.Name), 3) = "car" Then
ActiveDocument.SaveAs _
FileName:="C:\Whatever\" & ActiveDocument.Name, _
FileFormat:=wdFormatDocument
End If

HTH
 

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