Which version of Word first supported the .ActivePrinter property
Can anyone tell me what service pack/version the .activePrinter property was introduced in for word?
I've developed an app on a machine with word 10 object library and it works fine but our build machine only has word 8. It'll build OK on that machine but when we come to run it on the test machine (which has word 2002 sp 2 so is pretty up to date) I get automation errors if I've accessed this property.
Any clues would be a great help.
Re: Which version of Word first supported the .ActivePrinter property
So far I can verify that .ActivePrinter is available on Word 2000 (9.0).
Still looking for verification for Word 97. :)
Re: Which version of Word first supported the .ActivePrinter property
Looks like the closest I can get without looking for my old Office 97 CD and installing it on a test system :D
http://support.microsoft.com/kb/167223
Re: Which version of Word first supported the .ActivePrinter property
Hi RD and thanks for the feedback. There's no mention of the .ActivePrinter property so I guess it wasn't available. As a temporary measure I'll build the app on a more up to date machine but this breaks or normal procedure so I was wondering, was there a way of setting the printer programmatically in 97? None of the examples in the help file do it so I'm guessing it can't be done.
BTW, when you gain the title Supermoderator do you get your own cape?
Re: Which version of Word first supported the .ActivePrinter property
You can use most any VB6 code to set the printer, I believe as long as its in a module. Search the forums for Printer. ;)
Yes, I have a black and silver cape with the Raiders shield on it. :D
Re: Which version of Word first supported the .ActivePrinter property
Quote:
I have a black and silver cape with the Raiders shield on it.
Does that mean you write pirate software? Sorry, that was just plain bad.
Looks like I can play with the printer object. I had tried setting Printer.deviceName but this changes the default printer and (because outlook is keeping a copy of word open in the background) word never get's a chance to pick it up. From looking at this thread I might be able to reset the printer object itself which I hadn't thought of. I'll give it a try when I get back into work tomorrow.
Re: Which version of Word first supported the .ActivePrinter property
Yes, thats more or less what I was meaning. :)
No pirate software here. The Raiders are an NFL football team. ;)
Re: Which version of Word first supported the .ActivePrinter property
Huzzah - I'm finally there.
I did the following in a dummy app:-
VB Code:
Private Sub Form_Load()
Dim prtPrinter As Printer, app As Word.Application, doc As Word.Document
Set app = New Word.Application
Set doc = app.Documents.Open("c:\Test2.doc")
For Each prtPrinter In Printers
If prtPrinter.DeviceName = "Kyocera FS-1750" Then
Set Printer = prtPrinter
Exit For
End If
Next
Printer.Print doc.Content
Set doc = Nothing
app.Quit
Set app = Nothing
End Sub
And out it came. Thought I'd post it here because it wasn't immediately obvious to me that I'd have to print doc.content rather than just doc (which just prints the filename.
Isn't the raiders symbol a pirate? I thought it was (us Brits kinda fell in love with American footbal in the 80's by the way - I was a bears fan - the fridge rocked - but we're headed in to chit chat territory)
>>edit - erm - aren't the vbcode tags working any more?
Re: Which version of Word first supported the .ActivePrinter property
Aaaarrgghhhh, no it isn't working. When I ran it over a test file with some basic text in it all, all was peachy. However when I cme to do it over a real document I got 'object does not support this property or method'. I'm guessing this is something to do with the fact that the real doc contains tables and/or we've done a mail merge on it. I think I'm going to have to stick with a more up to date build for now as I'm gonna get shouted at if I spend anymore time on this. Thanks for your help getting me this far though RD.
Re: Which version of Word first supported the .ActivePrinter property
You can use the ShellExecute API passing the "Print" verb to print a document. Less code and dont have to deal with the printer object but not sure if its what you need.
Re: Which version of Word first supported the .ActivePrinter property
Sadly our standard build procedure doesn't allow me to include the shell32 dll (we only include a pre-defined subset of the available components). Don't even get me started on that particular management decision. Hrumph!!
I could include it in a non standard build but then I might as well use a more up to date word object instead.
Re: Which version of Word first supported the .ActivePrinter property
That sucks. Shell32 is a good dll for all your shelling needs :D