|
-
Aug 18th, 2006, 02:11 AM
#1
Thread Starter
Member
{Resolved}Printing Word from VB
i have a program that based on user inputs will populate a word template. i have this working geat. i do know how to print it, but depending on an input from the user i will need either one two or three copies. i need to do this so the user doesnt have to make the decision as some of the users are not realy computer literate. any help would be greatly appreciated.
thanks
Last edited by Hack; Aug 18th, 2006 at 10:38 AM.
Reason: Added green "resolved" checkmark Last edited by chaser74 : Today at 10:56 AM.
-
Aug 18th, 2006, 02:17 AM
#2
PowerPoster
Re: Printing Word from VB
have you tried using the search facility of the forum? Im sure you'll get alot of thread answering the same question.
-
Aug 18th, 2006, 02:27 AM
#3
Re: Printing Word from VB
Application.PrintOut has a parameter named [Copies], add the number of copies there.
-
Aug 18th, 2006, 08:19 AM
#4
Thread Starter
Member
Re: Printing Word from VB
Here is the code i am using to print out the forms but i geta compile error everytime i run the program. any thoughts
VB Code:
If optOTC = True Or optLoaner = True Then
objWord.PrintOut.Copies = 1
ElseIf optSignal = True Then
objWord.PrintOut .Copies = 2
ElseIf optRepair = True Then
objWord.PrintOut.Copies = 3
End If
-
Aug 18th, 2006, 08:26 AM
#5
Re: Printing Word from VB
What line is the error on?
objWord.PrintOut Copies:=3
Should be the format.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 18th, 2006, 08:29 AM
#6
Hyperactive Member
Re: Printing Word from VB
Note the [Copies] Parameter:
VB Code:
oWord.PrintOut ([Background], [Append], [Range], [OutputFileName], [From], [To], [Item], [Copies], [Pages], [PageType], [PrintToFile], [Collate], [FileName], [ActivePrinterMacGX], [ManualDuplexPrint], [PrintZoomColumn], [PrintZoomRow], [PrintZoomPaperWidth], [PrintZoomPaperHeight])
-
Aug 18th, 2006, 09:32 AM
#7
Thread Starter
Member
Re: Printing Word from VB
this is the code i am using now but i get a user compile error varriable not defined and it highlights the the first "COPIES=1"
do i need to add another reference in my project as all i have now is ms word library11?
VB Code:
If optOTC = True Or optLoaner = True Then
objWord.PrintOut Copies = 1
ElseIf optSignal = True Then
objWord.PrintOut Copies = 2
ElseIf optRepair = True Then
objWord.PrintOut Copies = 3
End If
-
Aug 18th, 2006, 09:36 AM
#8
Re: Printing Word from VB
As RobDog888 points out, it could be:
Copies:=3
not just
Copys = 3
-
Aug 18th, 2006, 09:55 AM
#9
Thread Starter
Member
Re: Printing Word from VB
thanks hack that is what is was. you rock
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|