Solved

print record twice

Posted on 2007-04-10
4
363 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 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

707 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