View Single Post
 
Old 11-21-2014, 04:55 AM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Alternatively you could use the following function as a custom process

Code:
Function Rename(oDoc As Document) As Boolean
    On Error GoTo Err_Handler

    Dim oTable As Table
    Dim oTable2 As Table
    Dim oCell As Range
    If oDoc.Tables.Count = 0 Then GoTo Err_Handler
    Set oTable = oDoc.Tables(1)
    Set oTable2 = oTable.Range.Cells(4).Tables(1)
    Set oCell = oTable2.Range.Cells(6).Range
    oCell.End = oCell.End - 1
    oDoc.SaveAs Filename:=oDoc.Path & Chr(92) & Replace(oCell.Text, "/", "") & ".docx"
    Rename = True
lbl_Exit:
    Exit Function
Err_Handler:
    Rename = False
End Function
with http://www.gmayor.com/document_batch_processes.htm to handle the batch processing.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote