From: RPMitchal on
Word 2007

Dear Gurus:

I am attempting to find a macro that would possibly run an already existing
macro upon all files within a specific folder.

For example: I need to convert all existing styles within a series of
resumes to styles newly created in a template by someone else.

I have created the macro that will make the style conversions, but I am
further in need of a process by which this macro can be automatically applied
to all files within a given folder.

Any assistance in this regard will be greatly appreciated.

Thanks - Rod


From: DaveLett on
Hi Rod,
Have a look at this article http://word.mvps.org/FAQs/MacrosVBA/BatchFR.htm

HTH,
Dave
From: RPMitchal on
Hello Dave:

Thanks so much for your quick and helpful response. I had previously
checked out and actually made use of the link to which you directed me. My
problem seems to be that I remain perplexed by VBA.

I would have no idea how to modify the coding so that I could incorporate an
existing macro instead of using the *find and replace* feature.

If you are able to shed any further light on the subject or the necessary
modifications I would need to make, I would continue to be very appreciative.


Thanks Again - Rod


"DaveLett" wrote:

> Hi Rod,
> Have a look at this article http://word.mvps.org/FAQs/MacrosVBA/BatchFR.htm
>
> HTH,
> Dave
From: Fumei2 via OfficeKB.com on
Sub TheStuffToDo()
' the coding to do the processing on each opened file
' yadda yadda
' yadda yadda
End Sub

Sub DoItNow()
Dim file
Dim path As String

' the path to the folder
' make SURE you include the terminating "\"
Path = "c:\yadda\whatever\"

file = Dir(path & "*.doc")
Do While file <> ""
Documents.Open Filename:=path & file
' call to macro that does whatever
' one would assume it is using ActiveDocument!
CALL TheStuffToDo
' assuming you want to save the current file
ActiveDocument.Save
ActiveDocument.Close
' set file to next in Dir
file = Dir()
Loop
End Sub

In other words, use Dir to GET each file, and then CALL to the macro you
already have to do the actions.
RPMitchal wrote:
>Hello Dave:
>
>Thanks so much for your quick and helpful response. I had previously
>checked out and actually made use of the link to which you directed me. My
>problem seems to be that I remain perplexed by VBA.
>
>I would have no idea how to modify the coding so that I could incorporate an
>existing macro instead of using the *find and replace* feature.
>
>If you are able to shed any further light on the subject or the necessary
>modifications I would need to make, I would continue to be very appreciative.
>
>
>Thanks Again - Rod
>
>> Hi Rod,
>> Have a look at this article http://word.mvps.org/FAQs/MacrosVBA/BatchFR.htm
>>
>> HTH,
>> Dave

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/word-programming/200912/1

From: RPMitchal on
Fumei:

Thanks so much. I can't tell you just how much I appreciate the assistance
and feedback that I receive from the Forum.

Rod


"Fumei2 via OfficeKB.com" wrote:

> Sub TheStuffToDo()
> ' the coding to do the processing on each opened file
> ' yadda yadda
> ' yadda yadda
> End Sub
>
> Sub DoItNow()
> Dim file
> Dim path As String
>
> ' the path to the folder
> ' make SURE you include the terminating "\"
> Path = "c:\yadda\whatever\"
>
> file = Dir(path & "*.doc")
> Do While file <> ""
> Documents.Open Filename:=path & file
> ' call to macro that does whatever
> ' one would assume it is using ActiveDocument!
> CALL TheStuffToDo
> ' assuming you want to save the current file
> ActiveDocument.Save
> ActiveDocument.Close
> ' set file to next in Dir
> file = Dir()
> Loop
> End Sub
>
> In other words, use Dir to GET each file, and then CALL to the macro you
> already have to do the actions.
> RPMitchal wrote:
> >Hello Dave:
> >
> >Thanks so much for your quick and helpful response. I had previously
> >checked out and actually made use of the link to which you directed me. My
> >problem seems to be that I remain perplexed by VBA.
> >
> >I would have no idea how to modify the coding so that I could incorporate an
> >existing macro instead of using the *find and replace* feature.
> >
> >If you are able to shed any further light on the subject or the necessary
> >modifications I would need to make, I would continue to be very appreciative.
> >
> >
> >Thanks Again - Rod
> >
> >> Hi Rod,
> >> Have a look at this article http://word.mvps.org/FAQs/MacrosVBA/BatchFR.htm
> >>
> >> HTH,
> >> Dave
>
> --
> Message posted via OfficeKB.com
> http://www.officekb.com/Uwe/Forums.aspx/word-programming/200912/1
>
> .
>