View Single Post
 
Old 07-03-2018, 07:45 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,469
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

For the first question, change:
TopLevelFolder = GetFolder
to something like:
TopLevelFolder = "C:\Users" & Environ("Username") & "\Documents"
That will cause the macro to start the search from your 'Documents' folder - you can drill down to a lower folder for the starting point, if you prefer.


Regarding the second question, you can use the Application.OnTime method to run a macro at a specified time or interval. For example:
Code:
Private Sub Document_Open()
Call Main
End Sub
would run the 'main' macro immediately the document is opened. If you were to add:
Code:
Application.OnTime When:=Now + TimeValue("01:00:00"), Name:="Main", Tolerance:=0
to the end of the 'Main' macro, the process would repeat every hour - provided the document remains open.

As for your third question, you could insert:
Code:
      If .InlineShapes.Count > 0 Then
        With .InlineShapes(1).PictureFormat
          .CropBottom = 110
          .CropTop = 165
        End With
      End If
between:
.RemoveDocumentInformation (wdRDIAll)
and:
.Close SaveChanges:=True
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote