Thread: [Solved] Filename
View Single Post
 
Old 08-19-2016, 12:13 AM
UnlimitedPower UnlimitedPower is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Aug 2016
Posts: 1
UnlimitedPower is on a distinguished road
Default Filename

Hello,

I'm creating a word document that imports text from a other document trough "Mailings". This generates 1 file with all the data.
I use the following code to save each page to 1 file.

Code:
Sub BreakOnPage()
   Application.Browser.Target = wdBrowsePage
   For i = 1 To ActiveDocument.BuiltInDocumentProperties("Number of Pages")
 
     ActiveDocument.Bookmarks("\page").Range.Copy
      Documents.Add
      Selection.Paste
      Selection.TypeBackspace
      ChangeFileOpenDirectory "Z:\"
      DocNum = DocNum + 1
      ActiveDocument.SaveAs FileName:="Verslag_" & DocNum & ".doc"
      ActiveDocument.Close
      Application.Browser.Next
   Next i
   ActiveDocument.Close savechanges:=wdDoNotSaveChanges
End Sub
I'm a total noob at this but I would like to copy a word from the generated file and paste it in the title. Is this possible?

Kind Regards,
Reply With Quote