I found the following macro on the internet (from someone else's
question)and it is working for me, except that it is saving the documents all
to my C drive.
How can I program a path eg. C:\A_Data\Word\Merge

Dim x As Long
Dim Sections As Long
Dim Doc As Document

Application.ScreenUpdating = False
Application.DisplayAlerts = False

Set Doc = ActiveDocument

Sections = Doc.Sections.Count
For x = Sections - 1 To 1 Step -1
Doc.Sections(x).Range.Copy
Documents.Add
ActiveDocument.Range.Paste
ActiveDocument.SaveAs (Doc.Path & "\" & x & ".doc")
ActiveDocument.Close False
Next x

Application.ScreenUpdating = True
Application.DisplayAlerts = True

End Sub
Hoping someone can help me with this.
--
PaulineC

Re: Setting a Path in Word VBA by macropod

macropod
Sat Oct 29 02:34:19 CDT 2005

Hi Pauline,

Simply change the 'Doc.Path' reference to your preferred path. So, instead
of:
ActiveDocument.SaveAs (Doc.Path & "\" & x & ".doc")
use:
ActiveDocument.SaveAs ("C:\A_Data\Word\Merge" & "\" & x & ".doc")

Cheers


"paulinec" <paulinec@discussions.microsoft.com> wrote in message
news:50FD6328-1B0A-4F5E-90C6-9501BC5D80CB@microsoft.com...
> I found the following macro on the internet (from someone else's
> question)and it is working for me, except that it is saving the documents
all
> to my C drive.
> How can I program a path eg. C:\A_Data\Word\Merge
>
> Dim x As Long
> Dim Sections As Long
> Dim Doc As Document
>
> Application.ScreenUpdating = False
> Application.DisplayAlerts = False
>
> Set Doc = ActiveDocument
>
> Sections = Doc.Sections.Count
> For x = Sections - 1 To 1 Step -1
> Doc.Sections(x).Range.Copy
> Documents.Add
> ActiveDocument.Range.Paste
> ActiveDocument.SaveAs (Doc.Path & "\" & x & ".doc")
> ActiveDocument.Close False
> Next x
>
> Application.ScreenUpdating = True
> Application.DisplayAlerts = True
>
> End Sub
> Hoping someone can help me with this.
> --
> PaulineC