I'm using Visual Basic and i'm creating a Word doc and writing to it. I want page borders ONLY on page 1. I used the code below to create the page borders, but when I create them any page after the coverpage also has borders, which I dont want. I've read this thread(http://www.vbforums.com/showthread.p...=word+sections), but I cant figure out how to reference the second section. Any help would be appreciated.
Thanks
Code:With objApp.Selection.Sections(1).Borders(WdBorderType.wdBorderLeft) .LineStyle = WdLineStyle.wdLineStyleSingle .LineWidth = WdLineWidth.wdLineWidth050pt .Color = WdColor.wdColorBlack End With With objApp.Selection.Sections(1).Borders(WdBorderType.wdBorderRight) .LineStyle = WdLineStyle.wdLineStyleSingle .LineWidth = WdLineWidth.wdLineWidth050pt .Color = WdColor.wdColorBlack End With With objApp.Selection.Sections(1).Borders(WdBorderType.wdBorderTop) .LineStyle = WdLineStyle.wdLineStyleSingle .LineWidth = WdLineWidth.wdLineWidth050pt .Color = WdColor.wdColorBlack End With With objApp.Selection.Sections(1).Borders(WdBorderType.wdBorderBottom) .LineStyle = WdLineStyle.wdLineStyleSingle .LineWidth = WdLineWidth.wdLineWidth050pt .Color = WdColor.wdColorBlack End With




Reply With Quote
