?
Solved

print record twice

Posted on 2007-04-10
4
Medium Priority
?
367 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 375 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

764 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