Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Print
Eric M 
    
10 years ago
The following code populates a word document. I know this by the ".PrintPreview" line of code.
But...
I can't get the populated document to print.  It only prints (unpopulated).
Goal:
1. I want to print the populated document
2. I want to automatically print the two page word document on both sides of the paper
3. And I'd like to do all this with just a double click of the mouse.
(I'll remove the print preview line later, just left it in to see if anything populated).

Private Sub Info17_DblClick(Cancel As Integer)
   Dim appWord As Word.Application
        Dim doc As Word.Document
        'Avoid error 429, when Word isn't open.
        On Error Resume Next
        Err.Clear
        'Set appWord object variable to running instance of Word.
        Set appWord = GetObject(, "Word.Application")
            If Err.Number <> 0 Then
            'If Word isn't open, create a new instance of Word.
            Set appWord = New Word.Application
            End If
        'The current file  T:\NWLN\R8\Ships Force Testing\QA Form xxxxx.docx
        Set doc = appWord.Documents.Open("C:\Users\eric.m\Desktop\QA Form 17 latest.docx", , True)
            With doc
                .FormFields("txtCWP").Result = Me.CWP
                .FormFields("txtFullTask").Result = Me.FullTask
                .FormFields("txtJCN").Result = Me.UIC & "-" & Me.JSN
                .Visible = True
                .Activate
                .PrintPreview
                End With
Exit Sub
errHandler:
    MsgBox Err.Number & ": " & Err.Description
End Sub



Reply from Alex Hedley:

1. When you don't have the .PrintPreview does it populate?
Are Me.CWP etc values on the current Form?

2. For duplex printing I think you would have to set this in the Printer settings so it's already pre-configured.

3. Using the DblClick should work here.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/15/2026 9:08:15 AM. PLT: 1s