![]() ![]() Set objDestFolder = Session.Folders("mailbox name")._ Sub MovePrintedMail(oMail As Outlook.MailItem) Don't forget to change the mailbox name, using the name as it appears in the Folder list (it's your email address in newer versions of Outlook). This macro assumes the "move to folder" is a subfolder of the Inbox. In this example, I'm adding a new macro and calling it from the ItemAdd macro, after the PrintAttachments macro is called.Īt the end of the module, after the PrintAttachments macro, add the move macro. If you want to print the attachment then move the message to another folder, you'll either need to add the move code to the ItemAdd macro or add another macro and call it from the ItemAdd macro. ShellExecute 0, "print", sFile, vbNullString, vbNullString, 0 SFileType = LCase$(right$(oAtt.FileName, 4)) ' This code looks at the last 4 characters in a filename Private Sub PrintAttachments(oMail As Outlook.MailItem) Private Sub Items_ItemAdd(ByVal Item As Object) Set Folder = Ns.GetDefaultFolder(olFolderInbox) Set Ns = Application.GetNamespace("MAPI") Private WithEvents Items As Outlook.Items "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _īyVal lpFile As String, ByVal lpParameters As String, _īyVal lpDirectory As String, ByVal nShowCmd As Long) As Long Private Declare Function ShellExecute Lib "shell32.dll" Alias _ ' //' use Declare PtrSafe Function with 64-bit Outlook This starts the macro without the need to restart Outlook. Edit the code as needed then click in the Application_Startup() macro and press Run button (F8). To use, open the VBA editor using Alt+F11 and paste the following code into ThisOutlookSession. Original code was written for 32-bit Outlook and 3 character file extensions. Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias _ Print received attachments immediately code sample To use the macro with 64-bit Outlook, you need to add PtrSafe to Declare: ![]() How has your company saved money on printing costs? Let us know the secret to your money-saving printer success, and you may be our winner! Tell us here.The code looks at the last 4 characters, including the period and will work as long as you use 4 characters in each extension we want to check.Ĭase "xlsx", "docx", ".pdf", ".doc", ".xls" And we'll do another tip from Jen on Thursday about printing from Excel. ![]() Thanks, Jen Darr of PC Helps Support, for your tip. ![]() And that's a shame, since cutesy memos need some snide comments. If your boss likes to load memos up with multiple fonts and graphics using HTML, your print style won't work. Just don't let your boss see the snide comments you make about the memos.īe aware that Print Styles are outranked by HTML formatted messages. Jen also likes this mode because a short memo will take up half the page, leaving plenty of room for notes on the other half. Our goal here is to print the memo on two columns of a landscape page (wider than tall), rather than two pages of paper in portrait mode (taller than wide). Once you select the style, hit the Print button. The page size selected, Letter Half, will be used to print. When you want to print the next memo from an e-mail, click File > Print > Booklet Memo Style (or whatever you named your style). Click the Paper tab, go to the Page section, and choose Letter Half. Provide a new name in the Style Name Field, such as Booklet Memo Style. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |