Solved

print record twice

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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…

746 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

8 Experts available now in Live!

Get 1:1 Help Now