Select Preview/Print in Automation

  • Thread starter Thread starter Janne
  • Start date Start date
J

Janne

I want to Preview a Mailmerge (Access 2000/Word 2000)
Have code like this:
Set wordApp = CreateObject("Word.Application")
With wordApp
.Visible = True
.Documents.Open filename:="c:\BlaBla\Avisering.dot"
.ActiveDocument.Bookmarks("Name").Select
.Selection.Text = Me.Avisering.Column(4, OID)
 
Use the close statement in both code branches:

wordApp.ActiveDocument.Close (wdDoNotSaveChanges)

like this:

If Dummy = True Then 'Preview = True
wordApp.ActiveDocument.Close (wdDoNotSaveChanges)
Set wordApp = Nothing
Exit Function
End If
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Hi,
I have also tried this but then I there is no time to read the document.
The document close at once leaving a black screen and
Word not closed.
Janne
 
Back
Top