Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Changing Advanced Printer Properties

I was wondering if anyone out there knew how to change the advanced printer properties programatically.

I want to be able to change the advanced option 'Keep Printed Documents' to true every time I print from my application.

I don't want to have to do this manually because I want to avoid problems when future printers are added.

Thanks for any help.

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Changing Printer Properties
Hello all,

What I would like to do in VB is open up the properties of my printer and then change the port. I would like my document to be printed and then change the port back to what is was.

Does anybody have any code that does this?


Advanced Properties For PrintOut()
Hi Hope this is still alive

<< Application.PrintOut Range:=wdPrintRangeOfPages, Copies:=1, Pages:="22", Background:=False >>

This is working fine, but how would I do:

Dim MyPage as integer
MyPage = 22
Application.PrintOut Range:=wdPrintRangeOfPages, Copies:=1, Pages:=MyPage, Background:=False

This gives me a "Type Mismatch" error


Advanced Properties For PrintOut()
Hi !

Sorry for my bad english...

I need to print a word document from Vb code. (or eventualy from C#). It's import the user could zoom ; he can say : "i want 2/4/6 pages on a page, with/without border frame"

- I first used the Windows PrintDialog (System.Windows.Form.PrintDialog) to receive choices of the user.

Long traitment...

Then i called PrintOut. I found in PrintDialog properties some properties like pages, copies, collate, but i never found advanced properties of a specified printer, where i'll could find zoom propert ("4 page per page"). This property seems to be a printer driver property only. I never found those properties and i don't know what is the equivalent argument for PrintOut()... arghh!

- Then i used the Word PrintDialog, Dialogs(Microsoft.Office.Word.Interop.Word.WdWordDialog.wdDialogPrintF ile). First only a Dialogs.Show().

Long traitement..

Then i call Dialogs.Execute, to finally ask to word to launch his printing, with user configuration. It's strange, Word print with advanced properties of specified printer (like zoom, "4 page per page") and with the "Options..." properties, but he just ignore classic properties of the main print dialog, like "all/selection/range, copies, collate, zoom (another zoom )". With word printdialog, i noticed lots of bugs with Word if margins are out of doc...

-Somebody know where are advanced printer properties like zoom ?
-Somebody know what is the argument of PrintOut i need to use for this zoom ?
-Is it only possible?
-Have you more information about all PrintOut arguments, like append, background ?
-... and if i can simply give to PrintOut my PrinterDialog settings ?
-Any other suggestion?

I can't call the first PrintDialog (of Windows or Word) at the end of treatment, just before call the PrintOut/Dialog.Execute, because Word will potentially launch a one day repagination... (big big big document)

Advanced File Properties

I'm trying to extract the advanced properties of a file to get jpg information such as IsoSpeed, Camera Model, Date Picture Taken, etc.

I tried with the fileSystemObject and the dsofile.dll but cannot get them.  Anyone has a hint?



Referencing Advanced/Extended Font Properties
I have developed some VBA code which generates a 'font sheet' (a list of the standard 32 to 255 ASCII characters) for each of the fonts installed on my system.

At present this works very well. A directory is created with a unique name (based upon the date and time), this in turn is filled with directories A thru Z; then a preformatted .dot file is opened for each each font, the characters and font name are inserted, and finally the form is saved in the relevant alphabetical directory, (a .pdf version generated if requested).

My question relates to two areas:

1) Currently the code uses the FontNames collection which only references the 'basic/normal' font in each family, e.g. Arial, Times New Roman, ... rather than referencing each individual font file, e.g. Arial Regular, Arial Bold, Arial Italic, Arial Bold Italic, ... How can I reference each of these individual fonts?

2) I use the Microsoft Font Properties Extension on my system which reveals a great deal of interesting and useful information regarding each font (type, foundry, embedding level, etc. ...). It there any way I can reference this information in my VBA code? I would really like to add some of this information to my 'font sheets'.

Please help me if you can in idiot-proof explanations with code examples as I am a layman in these matters.

Thank You!

Advanced Case Changing Code Needed
  I've created a text editor, and i have created a function to change the case of the selected text. I have these options:
Sentence case
Title Case

I've done the first 3 with UCase, LCase and the following:
Code: Dim strTemp As String, strChar As String
    strTemp = ""
    strChar = ""
    For I = 1 To Len(TextToFormat) '??-1
        strChar = Mid(TextToFormat, I, 1)
        If 65 < Asc(strChar) _
        And Asc(strChar) < 90 Then 'UPPERCASE LETTER
            strChar = LCase(strChar)
          Else 'lowercase letter
            strChar = UCase(strChar)
        End If
        strTemp = strTemp & strChar
    Next I
    FormatCase = strTemp

  But I don't have a clue where to start on the other two (Title and Sentence)
Title should uppercase every 1st letter of a word and lowercase everyother e.g:
Quote:Help Me Please
Question:Does anyone have any suggestions? Remeber words are defined as a group of letters, not groups seperated with " ". Thanks

  If anyone knows a solution to sentence case (a little trickier), then please help me on that also

  Thanks for anyone who spent time thinking about this

Should I apologize if what I say burns your
ears and stains your eyes?!

Changing Paper Size In Cdl.ShowPrinter Won't Change Printer.width And Printer.height
I use this code to let the user change the paper size and orientation before printing.

VB Code:
CommonDialog.ShowPrintermsgbox printer.width & " " & printer.height 'print code here ...  

but under Windows XP even when I change the paper size from the dialog the vb's printer.width and printer.height arn't changed ....

Is there a better way to change the paper size .. and to retrieve the changed paper size ?

Changing Printer Preferences With VB.Printer
I don't know if this has been posted or not but I've been goggling this subject for the past hour with no significant breakthrough.

I have a report that can only be displayed if the user's default printer is set to Landscape. Otherwise I get an error "Report Width is larger than the paper width". So I am trying to force the user's default printer to landscape mode. Through the watch window I can see that the following code does set the printer to landscape mode, but I still get the above mentioned error. And I can see through the control panel that the code didn't change anything on the printer. Is this a Privilages problem or do I need to save the changes somehow. OR, can I suppress/dupe the error from the standard report object?


Private Function ChangePrinterSettings()
Dim pntDefault As VB.Printer

Set pntDefault = VB.Printer
With pntDefault
If .Orientation = vbPRORPortrait Then
.Orientation = vbPRORLandscape
End If
End With
End Function

Please Help - Changing TCP/IP Properties WIN 95/98
I need to programmatically set several things that can be found in Control Panel--->Network--->TCP/IP Properties (such as IP Address, Gateway, DNS Configuration, etc). This is on Windows 98 machines that are turned on for the first time. IP address will be STATIC. I can use an API but if there is a DOS utility out there for 95/98 I could run (passing all of the above as parameters) that would be ideal!
Thank you.

Changing Properties On The Fly
In the development stage, is it possible to change an object properties while the app is running? (I mean without using a variable to assign the property)

Printer Properties...
In one of my apps I need to print the content of a webbrowser control to different printers with using various settings...

As the webbrowser control doesn't allow me to print directly (with a print property or so), I'm using:


That works fine. I also found out how to set a printer to system default. So I can choose the printer by simply set it to system's default before loading the webbrowser control and make it printing the content.

But I'm unable to change default printer's properties (like print quality, which paper slot to use, ...) system wide. Using VB's printer object to set the properties doesn't take effect.

So this is my question: How to set default printer's properties system wide?


Printer Properties
Has anyone ever looped through the default printer properties to determine the name &amp; values of them???

I've got two identical printers in different locations that are outputing very different results from the same application, &amp; I would like to dump their properties. Would rather not individually name the properties, but LIKE to loop through them if possible.

Printer Properties
How would you go about dumping ALL the default printer properties to the printer, without knowing the property name.

Essentially, I'm trying to do is "for each property in printer" or "for N = 0 to printer.propertycount-1", etc.

any Ideas?


Printer Properties

I have a printer installed on my computer that prints to a file. Now I'm wondering if it's possible to change it's papersize and orientation from VB code? Can it be done with "Printer.Orientation" and "Printer.PaperSize"? If I for example want A3 format, how could I write that in code?


Printer Properties
I need to be able to display the properties of whatever the default printer happens to be.

How would I do that?

Printer Properties

i have several reports of diffrent layout and size.. and few are direct writtern to printer...

so i a look for changing the properties like paper size.. layout and other properties at runtime....
any suggestion welcome


Printer Properties
I'm having a hard time trying to run printer's properties via VB. Does anyone know how to do it?

Visual Basic Programmer (at least I want to be one)
You will hear a lot about it.

Printer Properties

I'm using a printer that prints to file as my default printer. Now I would like to change some properties for it, for example the paper size and the orientation. Could that be done with the "Printer" object? I am not printing stuff with the Printer object (the files I print are opened in their respective applications and printed), so maybe setting those properties with the Printer object won't affect the properties of the real, default printer?
How could it otherwise be done? Any API functions that could do that?
Thanks in advance.

Printer Properties
I'm doing some VBA work in Word97 for a company and I'm having the following problem.
I have written print macros for a number of different templates eg. Page one will print from Tray 1 (this tray contains letterhead paper) all other pages will print from Tray 3 then the macro inserts a "COPY" watermark in the document and prints a second copy from Tray 3. The print macro varies to suit the different templates and works fine on the printers in the head office of the company I have created these templates for however in all other branches different printers are used and these printers are configured to select trays by type (Letterhead, Plain) not by source (Tray1, Tray2) and I have been unable to get word to select the right tray. I'm getting desperate can anyone help me.

Changing Query Properties In VBA
Access 97.........

Can anyone tell me how to change the 'Top Values' property of a query using VBA ? Is it possible ?

I want to be able to alter how many records are returned programmatically if possible.

Help much appreciated

Changing Picture Properties Through VBA

I insert a picture in my Word document header like:
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.InlineShapes.AddPicture FileName:= "C:TMP est.jpg", LinkToFile:=True, SaveWithDocument:=True
Afterwards I need to resize and float this picture, but now I can't find how to edit the properties (eg. size, position, layout) of a picture in a documents header through VBA.
I tried to generate code by recording a macro, however when the macro recorder is running, I can't right click a picture anymore to change its properties?

Any suggestion how to accomplish this?


Changing Field Properties In VB
I'm looking to change the Default Value property for a field in an Access table.

I can't seem to figure out the dim/set to get to the table.

Changing Cell Properties With VB6
I'm using VB 6 and I would like to know if I can change properties of cells like font, font size, and font bold. Also if I can change column width and add Headers and footers. Thanks for any help.

Dim appXL As Excel.Application
Set appXL = New Excel.Application

With appXL
.Range("A1") = frmDataEntry.Caption
End With

Application.Dialogs(xlDialogPrint).Show 'opens print dialog box
Application.Dialogs(xlDialogSaveAs).Show 'opens save as dialog box

Set appXL = Nothing

Changing Properties In MS Access
Hello All, I have a table in an Access DB with a field defined as a Long Int. I need to change this to a Double without affecting the existing data. Actually, this needs to be fixed in 4 tables and 2 are linked to each other. While doing this through Access I have to unlink the 2 tables before changing the property and I can't figure out how to get VB to do that either. Sorry if this is a dumb question, but I am new to this.
Thanks in advance

Changing A Columns Properties On The Fly
I'm kind of a rookie at this and I have searched high and low for an answer. Is there a way to change a columns properties on the fly? E.g., say I want to change a text column from text to memo via VB code.

The closest I have come is to append a new column with the new properties and then ADO the data from the old to the new and then drop the old.

If this is true, can I add the new column with the same name as the old?

Changing The Extended Properties Of A Jpg
Hi Team, I want to be able to change the DatePictureTaken property on a jpg, does anyone know how to do this?



Changing Font Properties
I am trying to change properties of a Caption inside a label.

VB Code:
lblMain.Caption = "United Parcel Service" & chr$(10) & chr$(13) & Space$(5) & "The Default Freight Service of our company."

I want to make "United Parcel Service" underlined and Arial, 22pt.

I want to make "The Default Freight Service of our company." Arial, 18pt, no underline

How would I got about doing this?

Changing The Properties Of A PDF Document With VBA
Does anyone know of any sources of info for coding for V4??

Thanks for your help....


Changing Read Only Properties
I am trying to change the read only properties on a file though VB. Can this be done and if so how?

Thanks for your help

Changing Properties To Textboxes
Hi! I have a form with about 200 textboxes, for example from Text1 to Text201. I need to change the background of each textfield and disabling it... Well, since i do not want to do:


is there another (faster) way to change properties of a group of textboxes?

Thanks to all

Multy Changing Properties
How Can I Change Two Or Three Properties
Of A Control Like This

set Text1.Container=newContainer

And All Of Them are Changed Togther When Last Line Is Excuted?

[Edited by jahangir on 12-29-2000 at 04:28 PM]

Changing Properties At Run Time
How, at run-time, can I disable an item in a drop-down list box depending on what is selected in a second drop-down list box?


Need Help Changing Control Properties In
if i have a form with multiple textboxes on it, can someone please show me how to change a specific property on all of the textboxes at the same time.

Changing Properties Of A File
Hi VB Gurus,
Is there any API/code that will let me change the properties of a file (Title, Author, Subject, Category, Comments and Keywords) in VB.

Ashish Kumar

Changing Certain Object Properties
I want to the captions of 8 command buttons to change when a button is pressed.

cmdGo.Caption = "New"

This command gives an error.Also if I want to change the style of a comboBox this should work:

cmbBox.Style = 1

I am fairly inexperienced with visual basic. Any help would be appreicaited.

Changing Multiple Properties

This is not a code question but I have about 50 forms with about 30 picture box's in each form. I am creating a word search game. I now realized I want to make the mouse cursor change over each letter (a letter being a picture box). When I select all of the picture box's on the form it does not show the property MouseIcon and I don't want to do 1500 individual picture box's.

 Is there a way to do this without doing them individually?


Edited by - ppffpf on 7/2/2004 10:59:27 AM

Changing A Toolbar's Properties
I have a toolbar on a form, and i want to change the properties. But, for some reason it wont let me, is there a setting that locks a toolbars properties?

many thanks

Changing Properties Of A File

Is there any API/code that will let me change the properties of a file (Title, Author, Subject, Category, Comments and Keywords) in VB.

Ashish Kumar

Changing The Print Properties
I want to change the print properties during run time. Is there any way to change?

Changing ADODC Properties
Hi all,

I have an ADODC control, namely ADODCTest. I need to connect it to the Oracle database using MS OLE DB Provider for Oracle. However, i would like to have the flexibility of changing the properties of ADODC - Server Name, User Name and Password using the input from a form. That means, there should be some codes that can overide the default values as entered for the ADODC control properties.

I tried to do the do the following in my Form1:
Public ServerName As String
Public UserName As String
Public Password As String
Public ConnStr As String

Private Sub cmdChange_Click()

ServerName = txtServerName.Text
UserName = txtUserName.Text
Password = txtPassword.Text

ConnStr = "Provider=MSDAORA.1;Password=" & Password & ";User ID=" & UserName &

";Data Source=" & ServerName & ";Persist Security Info=True"

With DBConn
.ConnectionString = ConnStr
.CursorLocation = adUseClient
End With

Load Form2

Unload Form1

End Sub

In my Form2, i did the following :
Private Sub Form_Load()

AdodcTest.ConnectionString = ConStr
AdodcTest.UserName = UserName
AdodcTest.Password = Password

End Sub

When the application runs, it gives the following message :
ORA-00942: table or view does not exist.

This implies that the new ADODC Properties values are not overridden by the new input values from the form.

I tried to leave all the ADODC properties blank, but it gives me the following error whenever Form2 is loaded:
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver spesified.

Is there any example on how i can use the ADODC without being tied up to the control properties?
Thanks in advance.

Changing Properties Of Field
I want to change with MyApplication in VB properties of fields in existing Table of my database.

- MyDatabase
-- MyTable
--- MyField (type: Text, lenght: 50, .....)

How can I change propertie of Myfield ?
I want to change lenght from 50 to 100.



Changing Window Properties ?
I would like to disable the 'X' (close window in upper right corner) on a main window of an application. Can I do this ? All I have is the window handle passed in from another application. Thanks in advance.

Special Printer Properties
Hi all,

I have some problem with my barcode printer. It had special properties which we can set in the printer properties like the label gap width, using direct thermal, set the stock name, etc....
But how can I set it using VB bcause in the printer object, there's no indication of those special properties ?
It's un-cool if we need to print different kind of label and we need to change the printer setting manually.
Anyone know how to settle this problem ?



Datareport Printer Properties
Does anyone know a way to set the printer properties for a datareport? I have a program that prints bills off on 4" X 6" index cards, and as it stands the user would have to go through and select landscape and then the index card from the printer properties. Is there any way to do this for a datareport? I found this article which shows how you can set the default orientation(ie: landscape/portrait), but I don't have a clue if it's possible to pick the paper type(ie 4" X 6" postcard). Any ideas? Thanks!

I'd also like to mention that I am fed up with is so incredibly inflexible. Does anyone have a comment as to if crystal reports will be able to handle most things that the datareport can't. I'm thinking about purchasing it.

Setting New Printer Properties

I have actually the settings of about 300 printers to install, and I was wondering if anyone knows a(some) function(s) to set a new printer with all the properties attach to it(PaperBin, PaperSize, drivername, etc.).

API Lib "winspool.drv" ?


How Do I Set Default Printer Properties
I need to know how to change the paper bin of the Default Printer through APIs.

The only way that I'm able to control the MS DataReports, is through setting the Default Printer. I got that working, but now I need to be able to switch drawers so that I can switch between printing letter head and standard paper.

Does ANYONE know how to do this?

This is for Windows NT / 2000 clients



Change Printer Properties
hi Friend's
I want change Printer properties through vb. i want develop a one vb project in which i want true printer properties(Keep Printed Document) when it run.
which we can get from control panel->Printer->printer properties->Advance Tab we find "keep printed Document" Check box
And i am not find this properites in Printer Commandialog

Printer Properties Dialog Box

One more query based on Printer and Printing Options.
In VB, is there a that, on click of a button, I can open the Print Properties Dialog Box. I mean not the whole Printer Dialog Box but just the Print Properties dialog. Attached is the screenshot of the dialog box that I'm talking about.

I'll really thankful about any help on this...


Printer Setup Properties

how do i get the printer properties of a Printer command dialog?

i have this

VB Code:
dlgCommonDialog.DialogTitle = "Printer Setup"        dlgCommonDialog.CancelError = True        dlgCommonDialog.Flags = cdlPDPrintSetup + cdlPDReturnIC        dlgCommonDialog.ShowPrinter

i want to change the printer properties and save them so if i go to the printer setup again it will be with the same properties (like phot quality paper, good quality)

another thing do the Printer Setup dialog saves the properties in the printer automaticaly? so if i print after ir will have the properties chosen before?


Copyright 2005-08, All rights reserved