Hi all
I am trying to open all documents from a filepath, run a macro that deletes
the watermark, save and close the document. Is this possible.
What I have so far errors as marked below:
Sub Test()
Dim Odoc As Word.Documents
Set fs = Application.FileSearch
With fs
.LookIn = path '"C:\"
.FileName = "*.doc"
' ' .Open (fail)
End With
For Each Odoc In fs ' I get an error here, Object doesnt support
this property
Call DeleteGraphic
Odoc.save
Odoc.close
Next Odoc
'End With
End Sub
Thanks in advance
Helmut Weber - 17 Feb 2006 08:49 GMT
Hi Sydney,
http://www.word.mvps.org/FAQs/MacrosVBA/BatchFR.htm

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
Edward Thrashcort - 17 Feb 2006 09:23 GMT
Use the Dir() statement and open the document by name something like this
ChangeFileOpenDirectory "C:\My Documents"
f = Dir("*.doc")
While f <> ""
Documents.Open Filename:=f
'do the business
ActiveDocument.Close SaveChanges:=wdSaveChanges
f = Dir()
Wend
Eddie
> *From:* "Sydney" <sydneygal25@yahoo.com>
> *Date:* Fri, 17 Feb 2006 16:57:09 +1100
[quoted text clipped - 31 lines]
>
> Thanks in advance
Sydney - 19 Feb 2006 22:50 GMT
These work like a charm!
Thank you so much Edward and Helmut.
> Use the Dir() statement and open the document by name something like this
>
[quoted text clipped - 44 lines]
> >
> > Thanks in advance