Splitter Macro - One More Question

J

Jennifer Ready

Hello. The splitter now works. But my original document
has a picture on the top of every page. When I run the
splitter the new document has the picture but when I go
back to the original document the picture on the next page
is then missing. The remaining pages of the original
document still have the picture? Is there a fix for this?

Here is the splitter I am using:

Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
..Text = "^b"
..Replacement.Text = ""
..Forward = True
..Wrap = wdFindContinue
..Format = False
..MatchCase = False
..MatchWholeWord = False
..MatchWildcards = False
..MatchSoundsLike = False
..MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.HomeKey Unit:=wdStory, Extend:=wdExtend
Selection.Cut
Selection.Delete Unit:=wdCharacter, Count:=2
Documents.Add
Selection.Paste
End Sub
 
J

Jay Freedman

Hi, Jennifer,

The picture on the next page is being deleted along with the section break,
by the statement

Selection.Delete Unit:=wdCharacter, Count:=2

Just change the 2 to 1, and the macro will leave the picture.
 
J

Jennifer

THANKS this macro works now!!!
-----Original Message-----
Hi, Jennifer,

The picture on the next page is being deleted along with the section break,
by the statement

Selection.Delete Unit:=wdCharacter, Count:=2

Just change the 2 to 1, and the macro will leave the picture.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://www.mvps.org/word




.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top