Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

print record twice

Posted on 2007-04-10
4
Medium Priority
?
374 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

610 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