![]() |
#5
|
||||
|
||||
![]()
I would use a way of tagging each of the border shapes when I put them in. That way it is much easier to identify the borders and kill them off. The normal (cheats
![]() Code:
Sub AddRandomBorder() Dim aRng As Range, i As Integer, aPara As Paragraph, aShp As Shape Dim iWidth As Integer, iHeight As Integer With ActiveDocument.Sections(1).PageSetup iWidth = .PageWidth - 40 iHeight = .PageHeight - 40 End With 'Get rid of the existing borders For i = ActiveDocument.Shapes.Count To 1 Step -1 If ActiveDocument.Shapes(i).AlternativeText = "Page Border" Then ActiveDocument.Shapes(i).Delete Next i For Each aPara In ActiveDocument.Paragraphs Set aRng = aPara.Range aRng.Collapse Direction:=wdCollapseStart If aRng.Information(wdActiveEndPageNumber) > i Then Set aShp = ActiveDocument.Shapes.AddShape(Type:=1, Left:=20, Top:=20, _ Width:=iWidth, Height:=iHeight, Anchor:=aRng) With aShp .AlternativeText = "Page Border" .Line.ForeColor = RGB(Rnd() * 255, Rnd() * 255, Rnd() * 255) .Line.Weight = 3 .Fill.Transparency = 1 End With i = aRng.Information(wdActiveEndPageNumber) End If Next aPara End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
l39linden | Word Tables | 5 | 10-04-2013 02:06 AM |
![]() |
ketanco | Project | 1 | 03-30-2013 08:24 AM |
![]() |
choy | Word | 3 | 08-01-2012 09:12 PM |
random pop up wont go away | 464646 | OneNote | 0 | 05-01-2012 04:34 AM |
Only Random Border Lines Printing! | TheCatSpeaks | Excel | 4 | 05-17-2010 07:39 AM |