Results 1 to 12 of 12

Thread: Which version of Word first supported the .ActivePrinter property

  1. #1

    Thread Starter
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    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.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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.
    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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

    http://support.microsoft.com/kb/167223
    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  4. #4

    Thread Starter
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    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?

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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.
    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  6. #6

    Thread Starter
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    Re: Which version of Word first supported the .ActivePrinter property

    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.

  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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.
    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  8. #8

    Thread Starter
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    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:
    1. Private Sub Form_Load()
    2. Dim prtPrinter As Printer, app As Word.Application, doc As Word.Document
    3.  
    4. Set app = New Word.Application
    5. Set doc = app.Documents.Open("c:\Test2.doc")
    6.  
    7. For Each prtPrinter In Printers
    8.     If prtPrinter.DeviceName = "Kyocera FS-1750" Then
    9.         Set Printer = prtPrinter
    10.         Exit For
    11.     End If
    12. Next
    13. Printer.Print doc.Content
    14.  
    15. Set doc = Nothing
    16. app.Quit
    17. Set app = Nothing
    18. 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?
    Last edited by FunkyDexter; Feb 2nd, 2006 at 05:18 AM.

  9. #9

    Thread Starter
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    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.

  10. #10
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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.
    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  11. #11

    Thread Starter
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    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.

  12. #12
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Which version of Word first supported the .ActivePrinter property

    That sucks. Shell32 is a good dll for all your shelling needs
    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width