TechRepublic : A ZDNet Tech Community

Microsoft Office

Host: Susan Harkins
Contact

It’s common for an audience to pause a presentation by asking questions and comments. In fact, most presenters like to interact with the audience. However, if the question or comment isn’t relevant to the current slide, it can be a bit distracting. How can you black out (or white out) the current slide?

Last week we asked…

How do you draw a border around a report page in Access? Amasa was the only one to offer a solution — manually adding line objects to all four page margins. That method works, but it requires a steady hand and you must add vertical lines to each report section. In a complex report, that would mean a lot of work. VBA provides an easy and flexible method for drawing a border around a report page. Simply add the following subprocedure to the report’s module:

Private Sub Report_Page()
  Me.Line (0, 0)-(Me.ScaleWidth, Me.ScaleHeight), , B
End Sub

The above procedure uses the default line property settings to create a border around the report’s margins, enclosing all data, including headers and footers. You don’t have to use the default line properties though; simply set them in the same procedure as follows:

Private Sub Report_Page()
  'Draw border around report's margins. 
  On Error Resume Next
  'Set line's thickness and style.
  Me.DrawWidth = 3
  Me.DrawStyle = 3
  Me.Line (0, 0)-(Me.ScaleWidth, Me.ScaleHeight), vbBlue , B
End Sub

This procedure draws a thick, broken blue line around the margins. The higher the DrawWidth property value, the thicker the line. The DrawStyle property settings follow:

  • 0: (Default) Solid line
  • 1: Dash
  • 2: Dot
  • 3: Dash-dot
  • 4: Dash-dot-dot
  • 5: Invisible line
  • 6: Invisible line (solid interior)

The VB constant vbBlue determines the line’s color. There are several to choose from:

  • vbBlack
  • vbRed
  • vbGreen
  • vbYellow
  • vbBlue
  • vbMagenta
  • vbCyan
  • vbWhite

You can make a border-drawing procedure even more flexible by passing the line width and style values.

Print/View all Posts Comments on this blog

One key nigelboor | 11/11/09
In spanish amondracorp | 11/12/09
RE: Office challenge: How do you display a black or white screen, at anytime, during a PowerPoint presentation? michael-mps | 11/12/09
RE: Office challenge: How do you display a black or white screen, at anytime, during a PowerPoint presentation? mliesman@... | 11/12/09
RE: Office challenge: How do you display a black or white screen, at anytime, during a PowerPoint presentation? benb@... | 11/19/09

What do you think?

White Papers, Webcasts, and Downloads

Recent Entries

TR on Twitter

Archives

TechRepublic Blogs



500 Things Every Technology Professional Needs to Know
Did you know Microsoft's RegClean does not work with XP but you can use shareware to clean your registry? Did you know most wireless access points don't have encryption enabled by default? Did you know there are 500 tidbits of information contained in TechRepublic's 500 Things Every Technology Professional Needs to Know that will help you become a successful IT professional.
Buy Now
IT Professional's Guide to Policies and Procedures, Third Ed
Whether you're creating policies for management, training, personnel, support, privacy, Internet/e-mail usage, security, or inventory, you'll meet the needs of your entire enterprise with this one download!
Buy Now

SmartPlanet

Click Here