Hi Randy,
OK, if the useform & command button show, the code behind them should be there also. In that case, try adding something like:
MsgBox "!"
at different points in the code so that you can see where is runs to.
Instead of your latest sub, try:
Code:
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Dim Scn As Section, Rng As Range, Doc As Document
Dim StrPath As String, StrName As String
StrPath = "E:\Documents and Settings\" & Environ("UserName") & "\Desktop\EMS\"
If Dir(StrPath, vbDirectory) = "" Then
MkDir StrPath
End If
For Each Scn In ActiveDocument.Sections
Set Rng = Scn.Range
With Rng
.End = .End - 1
.Copy
End With
Set Doc = Documents.Add
With Doc
.Range.Paste
Set Rng = .Range.Paragraphs.First
With Rng
.End = .End - 1
StrName = .Text
End With
.SaveAs FileName:=StrPath & StrName & ".docx", AddToRecentFiles:=False
.Close
End With
Next
Set Rng = Nothing: Set Doc = Nothing
Application.ScreenUpdating = True
End Sub
This should save each Section in your active document as a new file in the target folder, which will be created if it doesn't already exist.