![]() |
|
|
Thread Tools | Display Modes |
#20
|
||||
|
||||
![]()
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
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to rename multiple Word file with same suffix | ozil61 | Word VBA | 2 | 05-06-2014 07:36 AM |
![]() |
SymphonyTomorrow | Word | 9 | 08-05-2013 05:31 PM |
![]() |
d4okeefe | Word VBA | 4 | 05-23-2013 09:35 AM |
![]() |
antztaylor | Excel | 5 | 11-08-2012 09:54 PM |
![]() |
Wyskers | Mail Merge | 1 | 11-30-2011 04:46 AM |