文書番号: 129722
最終更新日: 2001/06/20
Option Explicit
Sub ChgRptOrient(ReportName As String)
' WZFRMRPT.MDA ファイルの zwAllGlobals モジュール内の、
' zwtDevModeStr と zwtDeviceMode のタイプを定義します。
Dim DevString As zwtDevModeStr
Dim dm As zwtDeviceMode
' フィールドのメンバを定数とします。
Const DM_ORIENTATION = &H1
Dim stDevModeExtra As String
Dim rpt As Report
Dim msg As String
' レポートをデザイン ビューで開きます。
DoCmd.OpenReport ReportName, A_DESIGN
Set rpt = Reports(ReportName)
If Not IsNull(rpt.PrtDevMode) Then
' PrtDevMode プロパティを文字列型変数に代入します。
stDevModeExtra = rpt.PrtDevMode
DevString.RGB = stDevModeExtra
LSet dm = DevString
' 現在の印刷の向きを表示します。
msg = "The Orientation is currently"
If dm.dmOrientation = 1 Then
msg = msg & " Portrait. Change to Landscape?"
Else
msg = msg & " Landscape. Change to Portrait?"
End If
response = MsgBox(msg, 4)
If response = 6 Then
' はい を選択します。
' フィールド メンバを初期化します。
dm.dmFields = dm.dmFields Or DM_ORIENTATION
' 印刷の向きを設定します。
If dm.dmOrientation = 1 Then
' 印刷の向きを横に設定します。
dm.dmOrientation = 2
Else
' 印刷の向きを縦に設定します。
dm.dmOrientation = 1
End If
' PrtDevMode プロパティの最初の 68 バイトを更新します。
LSet DevString = dm
Mid$(stDevModeExtra, 1, 68) = DevString.RGB
rpt.PrtDevMode = stDevModeExtra
End If
End If
End Sub
Keywords: kbinfo kbprint KB129722
Technology: kbAccessSearch