I hope that someone can help me.
I have a code with use Application.FileSearch that works fine in WORD2003, but my company is going to use WORD2010 and while I was testing this code doesn't work any more because of the Application.Filesearch.
I read on internet that you must use something else then Application.Filesearch. But I don't know how to chance my code. Can someone please help me.
Sub opslaan() Dim strDir As String Dim strFileName As String Dim FSO As New Scripting.FileSystemObject strDir = Options.DefaultFilePath(wdDocumentsPath) 'Bestandslocatie documenten strFileName = ActiveDocument.Name ActiveDocument.Save ChangeFileOpenDirectory "t:\cor\" With Application.FileSearch .LookIn = CurDir .FileName = strFileName If .Execute > 0 Then With Dialogs(wdDialogFileSaveAs) .Name = "t:\cor\" & strFileName .Show End With Else ActiveDocument.SaveAs strFileName End If End With ActiveDocument.Close ChangeFileOpenDirectory strDir With Application.FileSearch .LookIn = CurDir .FileName = strFileName If .Execute > 0 Then FSO.DeleteFile strFileName, True Else End If End With Dialogs(wdDialogFileOpen).Show End Sub