ACC: How to Create an Updatable Unbound Word Object on a ReportID: Q190137
|
For special formatting considerations, you may want to include a Microsoft Word object on a Microsoft Access report. For example, you may want to give a user the ability to change the font size of a title without having to switch the report to design mode. This article shows you how to do so. The technique described is especially useful in a Microsoft Access run-time application.
Microsoft provides programming examples for illustration only, without warranty
either expressed or implied, including, but not limited to, the implied warranties of
merchantability and/or fitness for a particular purpose. This article assumes that you
are familiar with the programming language being demonstrated and the tools used to
create and debug procedures. Microsoft support professionals can help explain the functionality
of a particular procedure, but they will not modify these examples to provide added
functionality or construct procedures to meet your specific needs. If you have limited
programming experience, you may want to contact a Microsoft Certified Solution Provider
or the Microsoft fee-based consulting line at (800) 936-5200. For more information about
Microsoft Certified Solution Providers, please see the following page on the World Wide Web:
http://www.microsoft.com/mcsp/For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://www.microsoft.com/support/supportnet/overview/overview.aspThe following example enables you to change the header of a report from a form:
Private Sub ReportHeader_Format(Cancel As Integer, _
FormatCount As Integer)
Me!MyTitle.OleData = Forms!frmRunReport!CustomTitle.OleData
End Sub
Form: frmRunReport
------------------------------------------------------
Caption: Run Report
Unbound Object frame (Microsoft Word Document object):
Name: CustomTitle
Locked: No
Enabled: Yes
Command button:
Name: RunReport
Caption: Run Report
OnClick: [Event Procedure]
Private Sub RunReport_Click()
DoCmd.OpenReport "Sales by Category", acViewPreview
End Sub
For more information about getting help with Visual Basic for Applications, please see the following article in the Microsoft Knowledge Base:
Q163435 VBA: Programming Resources for Visual Basic for Applications
Additional query words: heading
Keywords : kbdta AccCon RptEvent KbVBA
Version : WINDOWS:7.0,97
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: July 6, 1999