Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Druckersteuerung unter Word

Empfohlene Antworten

Veröffentlicht

Hallo Leute,

ich möchte gerne von Access aus ein Word - Dokument drucken. So weit ganz gut, aber bisher kann ich nur auf dem Standarddrucker drucken. Ich möchte aber auch gezielt Drucker, Ein-/Ausgabefächer und den Duplexdruck ansteuern können. Hat jemand eine Idee? Hier mal meine Funktion:

Public Function Word_Datei_Drucken(Datei As String)

Dim oWordApp As Word.Application

Dim oWord As Word.Document

Set oWordApp = New Word.Application

oWordApp.Visible = False

oWordApp.ActivePrinter = "Xerox Doc Centre 460"

Set oWord = oWordApp.Documents.Add(Datei)

oWord.PrintOut False

oWordApp.Quit

End Function

Benutz doch einfach einen CommonDialog.

Mit dem Ding kannst du auch Drucker auswählen.

Kann ich damit auch Fächer und Duplex steuern? Wie Funktioniert der denn genau?

Gruß

Alex

Ich nehme mal an, du arbeitest an einem VB-Projekt.

Der commonDialog ist der Microsoft Common Dialog Control, bei mir in der Version 6.0. und muss über Komponenten... in das Projekt eingebunden werden.

VB kann mit dem Printer-Objekt nur auf den Standartdrucker drucken. Soll ein anderer Drucker als dieser verwendet werden, gibt es im Grunde genommen nur zwei Möglichkeiten:

1. Der andere Drucker wird als Standartdrucker deffiniert. Dann kann man auf dem gewählten Drucker mit den im Druckerdialog vorgenommenen Einstellungen drucken.

Der Nachteil ist, das der ausgewählte Drucker auch für andere Anwendungen dann der Standartdrucker ist. Auf jedem System gibt es nur einen Standartdrucker und die durch den Druckerdialog vorgenommenen Eistellungen sind Systemeinstellungen.

2. den Commondialog so konfigurieren, das er einen hDC (device context) zurückgibt.

mit diesem dc kann man mit VB-Bordmitteln allerdings nicht viel anfangen. Der Druckjob muss dann über die WinAPI gedreht werden. Wie das für Word gehen soll, weiss ich allerdings nicht.

Beispielcode für 1:

On Error Resume Next

CommonDialog1.PrinterDefault = True

CommonDialog1.CancelError = True

CommonDialog1.ShowPrinter

If Err Then

Exit Sub

End If

On Error GoTo 0

Beispielcode für 2:

On Error Resume Next

CommonDialog1.PrinterDefault = False

CommonDialog1.Flags = cdlPDReturnDC

CommonDialog1.CancelError = True

CommonDialog1.ShowPrinter

If Err Then

Exit Sub

End If

hDC = CommonDialog1.hDC 'hDC als long deklariert

On Error GoTo 0

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.