indspil makro?
Jeg er stødt på dette modul (se herunder).Jeg skal lave et lignende modul. Det ser ud som om det er en makro der er konverteret.....?
Kan man indspille en makro på excel-vis, og konvertere den til et modul?
******************************
Option Compare Database
Option Explicit
Public Const cPrinter = \"hp laserjet 4 plus\"
Public Function PrintSpecial(strReportName As String, strPrinterName As String, strWhere As String) As Integer
On Error GoTo PrintSpecial_Error
PrintSpecial = True
\'Virker kun med referatrapport, tilføj where parameter hvis andre rapporter
\'DoCmd.OpenReport strReportName, acPreview, , strWhere
DoEvents
\'Print first page
SendKeys \"^p\" \'Enter print dialog
SendKeys strPrinterName \'Put PrinterName string in selected printer-box
SendKeys \"%b\" \'Enter PrinterProperties dialog
SendKeys \"%p\" \'Select Source select-box
SendKeys \"n\" \'select \"Nederste bakke\"
SendKeys \"{Enter}\" \'Exit PrinterProperties dialog
SendKeys \"%s\" \'Go to Pages boxes
SendKeys \"1\" \'In from box print 1
SendKeys \"{Tab}\" \'Next box
SendKeys \"1\" \'In to box print 1
SendKeys \"{Enter}\" \'GO
DoEvents
\'Skriv side 2 til 9999
SendKeys \"^p\" \'Enter print dialog
SendKeys strPrinterName \'Put PrinterName string in selected printer-box
SendKeys \"%b\" \'Enter PrinterProperties dialog
SendKeys \"%p\" \'Select Source select-box
SendKeys \"s\" \'select \"Stor kapasitet\"
SendKeys \"{Enter}\" \'Exit PrinterProperties dialog
SendKeys \"%s\" \'Go to Pages boxes
SendKeys \"2\" \'In from box print 2
SendKeys \"{Tab}\" \'Next box
SendKeys \"9999\" \'In to box print 9999
SendKeys \"{Enter}\" \'GO
DoEvents
DoCmd.Close acReport, strReportName
PrintSpecial_Exit:
Exit Function
PrintSpecial_Error:
MsgBox Error$
PrintSpecial = False
Resume PrintSpecial_Exit
End Function
******************************
