Solved

print record twice

Posted on 2007-04-10
4
353 Views
Last Modified: 2013-11-27
Hello all,
            I have created a form that merges information from one record into MS word and prints out the document, then deletes the record from the table.

The following is the code i use to accomplish this;

DoCmd.RunCommand acCmdSaveRecord
DoCmd.SetWarnings False

Dim wordobj As Object
Set wordobj = GetObject("C:\Status\status letter.doc")
wordobj.MailMerge.DataSource.QueryString = "SELECT * FROM [MailMerge] WHERE ID = " & ID
wordobj.MailMerge.Destination = wdSendToNewDocument
wordobj.MailMerge.Execute
wordobj.Application.Options.PrintBackground = False
wordobj.Application.ActiveDocument.PrintOut
wordobj.Application.Quit wdDoNotSaveChanges
Set wordobj = Nothing

CurrentDb.Execute "Delete * FROM [MailMerge] WHERE ID = " & ID
DoCmd.RunCommand acCmdRecordsGoToNew
DoCmd.SetWarnings True



The word document "status letter.doc" has two pages one is an envelope (page 0) and the other is a letter (page 1).  Right now it works fine and prints both the envelope and the letter.  How would I print the envelope once then print the letter(page1) twice?

Thanks,
Shane
0
Comment
Question by:Jigzacura
  • 2
4 Comments
 
LVL 13

Expert Comment

by:wiswalld
ID: 18882190
DoCmd.PrintOut acPages, 1, 1, 2
0
 
LVL 13

Expert Comment

by:wiswalld
ID: 18882195
Actuallt it would be:

DoCmd.PrintOut acPages, 1, 2, 2
0
 
LVL 9

Accepted Solution

by:
Volibrawl earned 125 total points
ID: 18882204
Seems like the easy way would be to copy Page1 and paste it to Page2.  Then print the whole document.
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18882245
ActiveDocument.PrintOut Range:=wdPrintFromTo, From:="1", To:="3"

http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/office97/html/web/007.asp
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now