Hi everyone - I'm trying to create a macro to extract pages from word and save them as individual documents. I keep getting a compile error: Expected End of Statement error. The issue is the DocNum = DocNum + 1 line??
Any help would be appreciated!
Code
Sub mcrExtractPages()
Application.Browser.Target = wdBrowsePage
For i = 1 To ActiveDocument.BuiltInDocumentProperties("39")
ActiveDocument.Bookmarks("\page").Range.Copy
Documents.Add
Selection.Paste
ChangeFileOpenDirectory "H:\My Documents"
DocNum = DocNum + 1 ActiveDocument.SaveAs FileName:="RateLetter_" & DocNum & ".docx"
ActiveDocument.Close Application.Browser.Next
Next i
End Sub
Display More