in reply to WIN32::OLE Word

File::Find will recourse through each and every directory/file you have on the machine, and apply the code whenever it meets the conditions you set. What you set is "work on every file that ends with '.doc'.

As Perl's DWIM mechanism isn't telepathic (not yet, that is), you need to specify more. Either put more direction in the code, such as what file to work on (file name, contents to look for), or a more explicit path.
You can say return unless at the start of your sub to make it only work on the exact file.

Software speaks in tongues of man.
Stop saying 'script'. Stop saying 'line-noise'.
We have nothing to lose but our metaphors.

Replies are listed 'Best First'.
Re^2: WIN32::OLE Word
by fox8267 (Initiate) on Mar 14, 2008 at 20:27 UTC
    find will work only on given dirs. given sub should not close allready open docs from other dirs.. I wrote below mecro in word to save as htm and it does the same (closed all the file) as soon I exe it. is there any way we can control what doc we are closing.
    Sub Macro1() ' ' Macro1 Macro ' Macro recorded 3/14/2008 by amresh.dubey ' ChangeFileOpenDirectory "D:\Documents and Settings\amresh.dubey\De +sktop\" ActiveDocument.SaveAs FileName:="Testing cv.htm", FileFormat:=wdFo +rmatHTML _ , LockComments:=False, Password:="", AddToRecentFiles:=True, _ WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFo +nts:=False, _ SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsA +OCELetter:= _ False ActiveWindow.View.Type = wdWebView ActiveWindow.Close Application.Quit End Sub