Outlook Formular Drucken auf Leserseite im Querformat

Home-›Foren-›Outlook-›Outlook VBA-›Outlook Formular Drucken auf Leserseite im Querformat

  • Dieses Thema hat 0 Antworten und 1 Stimme, und wurde zuletzt aktualisiert 10:58 um 14. Juli 2006 von Unbekannt.
1 Antwort anzeigen (von insgesamt 1)
  • Autor
    Beitrag
  • #37090
    Unbekannt
    Teilnehmer

      Hallo Leute,

      ich habe ein Outlookformular, welches auf Leserseite ausgedruckt werden soll.
      Auf der Leserseite habe ich ein Druck Button eingefügt und folgenden VBCode hinterlegt (Siehe unten)
      Das Drucken auf der Leserseite funktioniert aber nciht.
      Auf Verfasserseite klappts mit dem Drucken wenn ich den Button dort einfüge.
      Der parameter (im Code fett ) für Öffne Word Dokument im Querformat funktioniert auch nicht.

      Was mache ich falsch?

      Ich hoffe, jemand kann mir helfen.

      Vielen Dank!!!

      Viele Grüße
      Marlen

      Sub cmdPrint_Click()
      Set oWordApp = CreateObject(\”Word.Application\”)
      If oWordApp Is Nothing Then
      MsgBox \”Couldn\’t start Word.\”
      Else
      Dim oWordApp
      Dim oWordDoc
      Dim oBMs
      Dim bolPrintBackground

      \’ Open a new document
      Set oDoc = oWordApp.Documents.Add

      \’ Set a page setup object variable
      Set oPS = oDoc.PageSetup

      \’ Reduce the margins to .5\” (36 points)
      oPS.TopMargin = 36
      oPS.BottomMargin = 36
      oPS.LeftMargin = 36
      oPS.RightMargin = 36
      oPS.Orientation = wdOrientLandscape

      \’ Paste in the screen shot
      oWordApp.Selection.Paste

      \’ Center the screen shot
      Const wdAlignParagraphCenter = 1
      oDoc.Paragraphs(1).Alignment = wdAlignParagraphCenter

      \’ Get the current Word setting for background printing
      bolPrintBackground = oWordApp.Options.PrintBackground

      \’ Turn background printing off
      oWordApp.Options.PrintBackground = False

      \’ Print the Word document
      oDoc.PrintOut

      \’ Restore previous setting
      oWordApp.Options.PrintBackground = bolPrintBackground

      \’ Close and don\’t save changes to the document
      Const wdDoNotSaveChanges = 0
      oDoc.Close wdDoNotSaveChanges

      \’ Close the Word instance
      oWordApp.Quit

      \’ Clean up
      Set oPS = Nothing
      Set oDoc = Nothing
      Set oWordApp = Nothing

      End If
      End Sub

    1 Antwort anzeigen (von insgesamt 1)

    -