R
roortman
Hello to you all.
I am currently busy with something quite hard on my work.
I made a regular Mailmerge works fine. But now i want the merge to b
saved in different files, not 1 large file.
I used this code to accomplish this:
Works fine, when running this code it makes seperate files name
test1.doc, test2.doc etc. etc.
Now comes the hard thing, i want the filename to excist in 2 things:
the username of the person (which is supplied from the sourcefile) an
2nd the application name (which is also supplied from the sourcefile)
Doing this should make names like:
Robbert Windows xp.doc
So who knows what code to use???
PLS HELP ME OUT!!
I am currently busy with something quite hard on my work.
I made a regular Mailmerge works fine. But now i want the merge to b
saved in different files, not 1 large file.
I used this code to accomplish this:
Sub BreakOnPage()
' Used to set criteria for moving through the document by page.
Application.Browser.Target = wdBrowsePage
For i = 1 To ActiveDocument.BuiltInDocumentProperties("Number o
Pages")
'Select and copy the text to the clipboard.
ActiveDocument.Bookmarks("\page").Range.Copy
' Open new document to paste the content of the clipboar
into.
Documents.Add
Selection.Paste
' Removes the break that is copied at the end of the page, if any.
Selection.TypeBackspace
ChangeFileOpenDirectory "C:\"
DocNum = DocNum + 1
ActiveDocument.SaveAs FileName:="test_" & DocNum & ".doc"
ActiveDocument.Close
' Move the selection to the next page in the document.
Application.Browser.Next
Next i
ActiveDocument.Close savechanges:=wdDoNotSaveChanges
End Sub
Works fine, when running this code it makes seperate files name
test1.doc, test2.doc etc. etc.
Now comes the hard thing, i want the filename to excist in 2 things:
the username of the person (which is supplied from the sourcefile) an
2nd the application name (which is also supplied from the sourcefile)
Doing this should make names like:
Robbert Windows xp.doc
So who knows what code to use???
PLS HELP ME OUT!!