View Single Post
 
Old 02-18-2015, 01:33 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim strPath As String, strFileName As String
Dim oDoc As Word.Document
  strPath = ThisDocument.Path & Application.PathSeparator
  strFileName = Dir$(strPath & "*.doc")
  While Len(strFileName) <> 0
    If Not strFileName = ThisDocument.Name Then
      Set oDoc = Documents.Open(strFileName, , , False, , , , , , , , False)
      On Error Resume Next
      oDoc.Tables(1).Cell(3, 3).Range.Text = _
         Left(ThisDocument.Tables(1).Cell(2, 3).Range.Text, Len(ThisDocument.Tables(1).Cell(2, 3).Range.Text) - 2)
      On Error GoTo 0
      oDoc.Close wdSaveChanges
    End If
    strFileName = Dir$()
  Wend
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote