Really Customized Macro

  • Thread starter Thread starter MelMisMo
  • Start date Start date
M

MelMisMo

The other posts don't answer exactly what I need, so I am starting a new
question. I need to write a custom macro for the file/pathname. I have
already got one but our filenames are really long and need to cut out PART of
the file names. By this I mean, currently they are s:/open clients/12345 -
Client Name/00001 - Matter Name/Document Title.

I need it to read as: 12345.00001.Document Name

Anyone? Please, any help would be greatly appreciated -- Thanks
 
Dim fname As String
With ActiveDocument
fname = .FullName
fname = Mid(fname, 17)
fname = Left(fname, InStr(fname, " ") - 1) & "." & Mid(fname,
InStr(fname, "\") + 1, InStr(fname, "-") - 1 - InStr(fname, "\") - 1) & "."
& Mid(fname, InStrRev(fname, "\") + 1)
.Sections(1).Footers(wdHeaderFooterPrimary).Range.Text = fname
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

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

Back
Top