Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I use mail merge to generate letters. These are then merged into one large document which I used to use a splitter for when using Word 2003.

Now I am using Word 2010 and when I run the macro it edits the document, and rather than fitting everything on one page it plays around with it so it is split between 2.

I am using the following macro:

Sub SplitMerge()
' Macro created 16-08-98 by Doug Robbins to save each letter created by a
' mailmerge as a separate file.
' with modifications by Graham Mayor 16-06-03 & 08-10-04
Dim Title As String
Dim Default As String
Dim MyText As String
Dim MyName As Variant
Dim MyPath As String
Dim Letters As String
Dim Counter As Long
Dim DocName As String
Dim oDoc As Document
Dim oNewDoc As Document
Set oDoc = ActiveDocument
oDoc.Save
Selection.EndKey Unit:=wdStory
Letters = Selection.Information(wdActiveEndSectionNumber)
Selection.HomeKey Unit:=wdStory
Counter = 1
Default = "Merged"
MyText = "Commencement Letter"
Title = "File Name"
MyName = InputBox(MyText, Title, Default)
If MyName = "" Then End
Default = "T:\Lead Employer Service\HR Team\!Recruitment Team\!National Recruitment\2012\GP's\SUCCESSFUL CANDIDATES\"
Title = "Path"
MyText = "Enter path"
MyPath = InputBox(MyText, Title, Default)
If MyPath = "" Then End
While Counter < Letters
  Application.ScreenUpdating = False
  DocName = MyPath & MyName & " " & _
  LTrim$(Str$(Counter)) & ".doc"
  oDoc.Sections.First.Range.Cut
  Set oNewDoc = Documents.Add
  'Documents are based on the Normal template
  'To use an alternative template follow the link.
  With Selection
    .Paste
    .EndKey Unit:=wdStory
    .MoveLeft Unit:=wdCharacter, Count:=1
    .Delete Unit:=wdCharacter, Count:=1
  End With
  oNewDoc.SaveAs FileName:=DocName, _
  FileFormat:=wdFormatDocument, _
  AddToRecentFiles:=False
  ActiveWindow.Close
  Counter = Counter + 1
  Application.ScreenUpdating = True
Wend
oDoc.Close wdDoNotSaveChanges
End Sub

I have read on another page that this is a compatability issue but I'm not sure how to resolve it. I am pretty new to all this though, so as detailed advice as possible will be much appreciated.

share|improve this question
1  
Why don't you insert a page break where you want the new page to start. If you only want one page, try changing the margins of the page to make the data fit onto one page. –  wbeard52 Jun 18 '12 at 16:09
    
Its not the fact that it is on 2 pages that is the problem. it is changin the format of the docuemtn and putting like lots of spaces between paragraphs and things the docuemtn just doesnt look correct address block has moved and things –  Sean Chadwick Jun 20 '12 at 8:41
    
Seems like this is a compatability issue as i have run the same macro using both excel 2003 and word 2003 and it did work but my letter head vanished from the output files any ideas? –  Sean Chadwick Jun 20 '12 at 12:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.