I am trying to create a page break if a certain field Changes. But i cannot get this to work. Why? This is what i did and word is hanging.
This is done in VB6 calling aord with automation.
myword.ActiveDocument.MailMerge.Fields.Add myword.Selection.Range, FieldName
myword.Selection.CreateAutoTextEntry "PBF", myword.Selection.WholeStory
myword.ActiveDocument.Content.Delete
'myword.Selection.InsertBreak Type:=wdPageBreak
'myword.Selection.CreateAutoTextEntry "PB", myword.Selection.WholeStory
'myword.ActiveDocument.Content.Delete
myword.ActiveDocument.MailMerge.Fields.AddIf myword.Selection.Range, FieldName, wdMergeIfNotEqual, "PgeBreakV", "", "Ctrl+Enter"
myword.ActiveDocument.MailMerge.Fields.AddSet myword.Selection.Range, "PgeBreakV", , "PBF"
This is done in VB6 calling aord with automation.
myword.ActiveDocument.MailMerge.Fields.Add myword.Selection.Range, FieldName
myword.Selection.CreateAutoTextEntry "PBF", myword.Selection.WholeStory
myword.ActiveDocument.Content.Delete
'myword.Selection.InsertBreak Type:=wdPageBreak
'myword.Selection.CreateAutoTextEntry "PB", myword.Selection.WholeStory
'myword.ActiveDocument.Content.Delete
myword.ActiveDocument.MailMerge.Fields.AddIf myword.Selection.Range, FieldName, wdMergeIfNotEqual, "PgeBreakV", "", "Ctrl+Enter"
myword.ActiveDocument.MailMerge.Fields.AddSet myword.Selection.Range, "PgeBreakV", , "PBF"