Print only first two pages from attachment using vba code
Sub PrintMultiMails()
Dim olItems As Outlook.Items
Dim olItem As Outlook.MailItem
Set olItems = Application.Session.GetDefaultFolder(olFolderInbox).Items
For Each olItem In olItems
Call PrintFirstSecondPages
Next olItem
Set olItem = Nothing
Set olItems = Nothing
End Sub
Sub PrintFirstSecondPages()
SendKeys "%F"
SendKeys "p"
SendKeys "r"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "1-2"
SendKeys "{ENTER}"
End Sub