Access 2007 Print Preview Export/Publish Problem

  • Thread starter Thread starter PGC_Developer
  • Start date Start date
P

PGC_Developer

I have several application developed in Access 2000. In these applications a
user can choose to generate a report. The user is then presented with the
choice of directly printing the report or previewing the report. When the
user selects preview, they are presented with a preview of the report with a
custom ToolBar and MenuBar that allows for changing zoom levels and allows
them the standard built in Access capability to publish the report to Word or
analyze with Excel. This preview is instantiated in code. The MenuBar and
the ToolBar are custom and set in code prior to the preview being made
visible.

When the user publishes to Word, an RTF type document is generated. The
user can then modify, save, or email the document as needed. This internal
Access capability has worked fine in 97, 2000, and 2003.

With Access 2007 the user can preview and print the report as they did in
the previous versions of Access. The publish button is available and
contains and looks to provide the same capabilities, the same selections are
available. The problem is that when the user actually says to Publish It to
MS Word, the program blows up.

When you manually preview a report via the Access 2007 GUI, you can "Export"
the preview to different formats. In the case of Word, you are prompted for
a file name, and whether, or not, it should be opened by Word. This prompt
is not presented when the preview is instantiated in code as describe above.

Dim rpt As Report
gfPauseForPreview = True
'Declare and instantiate a copy of the report as defined in the "reports"
collection.
Set rpt = New Report_rpt_Areport

'Modify properties of the instantiated report.
rpt.Toolbar = "cstm_Print_Preview_Toolbar"
rpt.Caption = "Preview of: ArReport"
rpt.MenuBar = " "
rpt.MenuBar = "cstm_Print_Preview_Menu"

'Make the preview visible
rpt.VISIBLE = True

On Error GoTo AfterPause
Do While gfPauseForPreview
DoEvents
Loop

AfterPause:
Set rpt = Nothing

gfPauseForPreview is a public variable the is set to TRUE prior to the
report being made visible. After the report is made visible, a loop is
started to prevent the "rpt" object from going out of scope. When the user
is done with the preview, the "Close" event of the report changes the visible
property to false and sets the gfPauseForPreview to false, allowing the code
calling the preview to continue.

I need this functionality to be available in these applications. This is
used in several applications deployed within my agency. Having the ability
to publish to Word and then email reports save a lot of time.

I ran into a similar situation where Access 2007 was instantiating Word to
perform a mail merge. When done manually, a security prompt would be
presented. When done programmatically, the prompt would not be present and
the merge would not happen. This was addressed by MS KB 825765. Adding a
registry key turned the security prompt off. Is there a similar registry key
for the prompt present by Access 2007?

Any help would be greatly appreciated.

Thank you.
 
Hi,

Did you ever find a solution to this problem? My agency uses a 2003 mde and we have come across the same problem. I have not been able to find anything on the web that's related to this issue.

Any help would be appreciated.

Thanks.

Javed



PGC_Develope wrote:

Access 2007 Print Preview Export/Publish Problem
02-Jun-08

I have several application developed in Access 2000. In these applications a
user can choose to generate a report. The user is then presented with the
choice of directly printing the report or previewing the report. When the
user selects preview, they are presented with a preview of the report with a
custom ToolBar and MenuBar that allows for changing zoom levels and allows
them the standard built in Access capability to publish the report to Word or
analyze with Excel. This preview is instantiated in code. The MenuBar and
the ToolBar are custom and set in code prior to the preview being made
visible.

When the user publishes to Word, an RTF type document is generated. The
user can then modify, save, or email the document as needed. This internal
Access capability has worked fine in 97, 2000, and 2003.

With Access 2007 the user can preview and print the report as they did in
the previous versions of Access. The publish button is available and
contains and looks to provide the same capabilities, the same selections are
available. The problem is that when the user actually says to Publish It to
MS Word, the program blows up.

When you manually preview a report via the Access 2007 GUI, you can "Export"
the preview to different formats. In the case of Word, you are prompted for
a file name, and whether, or not, it should be opened by Word. This prompt
is not presented when the preview is instantiated in code as describe above.

Dim rpt As Report
gfPauseForPreview = True
'Declare and instantiate a copy of the report as defined in the "reports"
collection.
Set rpt = New Report_rpt_Areport

'Modify properties of the instantiated report.
rpt.Toolbar = "cstm_Print_Preview_Toolbar"
rpt.Caption = "Preview of: ArReport"
rpt.MenuBar = " "
rpt.MenuBar = "cstm_Print_Preview_Menu"

'Make the preview visible
rpt.VISIBLE = True

On Error GoTo AfterPause
Do While gfPauseForPreview
DoEvents
Loop

AfterPause:
Set rpt = Nothing

gfPauseForPreview is a public variable the is set to TRUE prior to the
report being made visible. After the report is made visible, a loop is
started to prevent the "rpt" object from going out of scope. When the user
is done with the preview, the "Close" event of the report changes the visible
property to false and sets the gfPauseForPreview to false, allowing the code
calling the preview to continue.

I need this functionality to be available in these applications. This is
used in several applications deployed within my agency. Having the ability
to publish to Word and then email reports save a lot of time.

I ran into a similar situation where Access 2007 was instantiating Word to
perform a mail merge. When done manually, a security prompt would be
presented. When done programmatically, the prompt would not be present and
the merge would not happen. This was addressed by MS KB 825765. Adding a
registry key turned the security prompt off. Is there a similar registry key
for the prompt present by Access 2007?

Any help would be greatly appreciated.

Thank you.

Previous Posts In This Thread:

Access 2007 Print Preview Export/Publish Problem
I have several application developed in Access 2000. In these applications a
user can choose to generate a report. The user is then presented with the
choice of directly printing the report or previewing the report. When the
user selects preview, they are presented with a preview of the report with a
custom ToolBar and MenuBar that allows for changing zoom levels and allows
them the standard built in Access capability to publish the report to Word or
analyze with Excel. This preview is instantiated in code. The MenuBar and
the ToolBar are custom and set in code prior to the preview being made
visible.

When the user publishes to Word, an RTF type document is generated. The
user can then modify, save, or email the document as needed. This internal
Access capability has worked fine in 97, 2000, and 2003.

With Access 2007 the user can preview and print the report as they did in
the previous versions of Access. The publish button is available and
contains and looks to provide the same capabilities, the same selections are
available. The problem is that when the user actually says to Publish It to
MS Word, the program blows up.

When you manually preview a report via the Access 2007 GUI, you can "Export"
the preview to different formats. In the case of Word, you are prompted for
a file name, and whether, or not, it should be opened by Word. This prompt
is not presented when the preview is instantiated in code as describe above.

Dim rpt As Report
gfPauseForPreview = True
'Declare and instantiate a copy of the report as defined in the "reports"
collection.
Set rpt = New Report_rpt_Areport

'Modify properties of the instantiated report.
rpt.Toolbar = "cstm_Print_Preview_Toolbar"
rpt.Caption = "Preview of: ArReport"
rpt.MenuBar = " "
rpt.MenuBar = "cstm_Print_Preview_Menu"

'Make the preview visible
rpt.VISIBLE = True

On Error GoTo AfterPause
Do While gfPauseForPreview
DoEvents
Loop

AfterPause:
Set rpt = Nothing

gfPauseForPreview is a public variable the is set to TRUE prior to the
report being made visible. After the report is made visible, a loop is
started to prevent the "rpt" object from going out of scope. When the user
is done with the preview, the "Close" event of the report changes the visible
property to false and sets the gfPauseForPreview to false, allowing the code
calling the preview to continue.

I need this functionality to be available in these applications. This is
used in several applications deployed within my agency. Having the ability
to publish to Word and then email reports save a lot of time.

I ran into a similar situation where Access 2007 was instantiating Word to
perform a mail merge. When done manually, a security prompt would be
presented. When done programmatically, the prompt would not be present and
the merge would not happen. This was addressed by MS KB 825765. Adding a
registry key turned the security prompt off. Is there a similar registry key
for the prompt present by Access 2007?

Any help would be greatly appreciated.

Thank you.


Submitted via EggHeadCafe - Software Developer Portal of Choice
Make your ASP.NET application install it's own Database
http://www.eggheadcafe.com/tutorial...11-738f4635fe06/make-your-aspnet-applica.aspx
 
Back
Top