Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function GetCurrentItem() As Object
- '******
- 'this function gets the selected item into an object. The item can be selected from an Explorer (folder View) or an Inspector (item View)
- '******
- Dim objOL As Outlook.Application
- Dim strWindowType As String
- On Error Resume Next
- Set objOL = Outlook.Application
- strWindowType = TypeName(objOL.ActiveWindow)
- Select Case strWindowType
- Case "Explorer"
- 'MsgBox "You selected a folder"
- Set GetCurrentItem = objOL.ActiveExplorer.Selection(1)
- Case "Inspector"
- 'MsgBox "You have opened an item"
- Set GetCurrentItem = objOL.ActiveInspector.CurrentItem
- End Select
- Set objOL = Nothing
- End Function
- Sub PrintDaten()
- Dim objItem As Object
- Set objItem = GetCurrentItem()
- Call Printare
- End Sub
- Sub Printare()
- MsgBox "Acum printez Daten"
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement