Select Preview/Print in Automation

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)
 
A

Arvin Meyer

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
 
J

Janne

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top