Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2005

Tip: Looking for answers? Try searching our database.

Problems testing for / setting properties on a printer.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ebbe - 13 Jun 2005 21:59 GMT
Hi

I want to make use of some printer capabilities (orientation, duplex and
trays).
How can I determine what capabilities is available?

In spite of knowing what a specific printer can, it is not possible to catch
the VBA code, by using the macro recorder, that select the properties.
How can I set the printer properties by using VBA?

I am using Office 2003

Ebbe
Jay Freedman - 14 Jun 2005 03:39 GMT
>Hi
>
[quoted text clipped - 9 lines]
>
>Ebbe

See these articles, especially the second and fourth ones:

http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=101
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=116
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=132
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=183

--
Regards,
Jay Freedman
Microsoft Word MVP         FAQ: http://word.mvps.org
Ebbe - 14 Jun 2005 07:29 GMT
Hi Jay!

Thank you, there is enough reading for quite a long time ;-)

Ebbe

>>Hi
>>
[quoted text clipped - 22 lines]
> Jay Freedman
> Microsoft Word MVP         FAQ: http://word.mvps.org 
Ebbe - 14 Jun 2005 16:59 GMT
Hi Jay!

Now I have tried to set the Duplex property, but it doesn't work.
I have tried to walk through in the debugger, but I don't see any problems.
Then I inserted an extra GetDuplex after the SetDuplex, and it shows that
the code isn't changed.

Sub PrintDuplexBooklet()

   Dim iDuplex As Long
   Dim iDuplex2 As Long

   iDuplex = GetDuplex     ' iDuplex Shows 1
   SetDuplex 3             'set for vertical binding
   iDuplex2 = GetDuplex    ' iDuplex2 Shows STILL 1 :-(

   ActiveDocument.PrintOut Background:=False
   SetDuplex iDuplex       'restore the original setting

End Sub

Any idears?

Ebbe

>>Hi
>>
[quoted text clipped - 22 lines]
> Jay Freedman
> Microsoft Word MVP         FAQ: http://word.mvps.org 
Jonathan West - 14 Jun 2005 17:08 GMT
This area of programming is notoriously difficult to manage. Some questions.

1. Is the printer local or networked?

2. If networked, have you installed a local printer driver?

3. Can you change the duplex setting through the printer properties page?

4. Have you managed to change any of the other properties of the printer by
code? If so, which?

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

> Hi Jay!
>
[quoted text clipped - 48 lines]
>> Jay Freedman
>> Microsoft Word MVP         FAQ: http://word.mvps.org
Ebbe - 14 Jun 2005 21:14 GMT
1: Yes, the printer is attached to the network.
2: Yes, I have the driver installed locally
3: Yes, I can change the Duplex property by the property window.
4: No, I have not tried to change other properties by code.

Some more information:
I discovered that setting duplex to long edge or short edge thrugh the
property window the GetDuplex function in both cases returned 2 and it
returned 1 when duplex was set to "None"

Ebbe

> This area of programming is notoriously difficult to manage. Some
> questions.
[quoted text clipped - 60 lines]
>>> Jay Freedman
>>> Microsoft Word MVP         FAQ: http://word.mvps.org
Ebbe - 16 Jun 2005 09:02 GMT
Hi Jonathan

Now I have reinstalled the printer incl. drivers.
This time I have connected it through the USB port.

Manipulating the propertied through control panel works.
But if I try changing properties by using VBA it does NOT works.

Any ideas?

Ebbe

> This area of programming is notoriously difficult to manage. Some
> questions.
[quoted text clipped - 60 lines]
>>> Jay Freedman
>>> Microsoft Word MVP         FAQ: http://word.mvps.org
Ebbe - 19 Jun 2005 22:04 GMT
Hi Jonathan again - again

Now it seems to work!
I have substituted the printerdriver delivered with the printer on a CD with
one downloaded.

Thanks to all trying to help
Ebbe
> This area of programming is notoriously difficult to manage. Some
> questions.
[quoted text clipped - 60 lines]
>>> Jay Freedman
>>> Microsoft Word MVP         FAQ: http://word.mvps.org
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.