![]() |
|
#2
|
||||
|
||||
|
Your attached template contains over 1000 lines of code. That's a lot to ask anyone to analyse, looking for problems. Some of it seems unnecessarily convoluted, too. For example, you could probably replace the calls to getNameOnly, which invokes:
Code:
Function getCurName() As String
getCurName = LCase(ActiveDocument.name)
End Function
Function getNameOnly() As String
Dim testString As String
Dim lastIndex As Integer
lastIndex = InStrRev(getCurName(), ".") - 1
testString = Mid(getCurName(), lastIndex, Len(getCurName()) - lastIndex)
getNameOnly = Mid(getCurName(), 1, lastIndex)
End Function
Code:
LCase(Split(ActiveDocument.Name, ".doc")(0)) Code:
ActiveDocument.path + "\" + ActiveDocument.name Code:
ActiveDocument.FullName
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Complex Directory
|
Optional_karl | Mail Merge | 1 | 09-29-2016 01:54 PM |
a complex IF formula perhaps?
|
robfreeman | Excel | 3 | 05-17-2016 04:58 AM |
I need help for a complex projet at my job
|
Elok | Word | 4 | 01-10-2013 08:28 AM |
| Giant table with numbers, complex text, images: Which program? | 8ruk3r | Office | 2 | 11-23-2012 05:31 PM |
Complex array formula
|
andrei | Excel | 9 | 02-03-2012 03:40 AM |