Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-15-2021, 01:14 AM
gazmoz17 gazmoz17 is offline Open attachment shortcut Windows 7 64bit Open attachment shortcut Office 2016
Novice
Open attachment shortcut
 
Join Date: Oct 2019
Posts: 6
gazmoz17 is on a distinguished road
Default Open attachment shortcut

Hi,




I dont think my Pdf viewer Sumatra supports preview?


I'm not interested in tabbing across with keyboard hoping was a VBA solution to quickly open attachment.


I have VBA scripts for printing attachments & marking read (mapped to autohotkey mouse button) wished to do the same for screening. I thought this would be easier to find on the web but struggling compared to other macro people have kindly posted/helped me with.


Many Thanks
Reply With Quote
  #2  
Old 07-15-2021, 01:46 AM
gmayor's Avatar
gmayor gmayor is offline Open attachment shortcut Windows 10 Open attachment shortcut Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The PDF Previewer is set through File > Options > Trust Center
If your current PDF application is not compatible why not install one that is?

See Set Outlook Default PDF Previewer - Super User
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 07-15-2021, 04:13 AM
gazmoz17 gazmoz17 is offline Open attachment shortcut Windows 7 64bit Open attachment shortcut Office 2016
Novice
Open attachment shortcut
 
Join Date: Oct 2019
Posts: 6
gazmoz17 is on a distinguished road
Default

Hi Graham, thanks for the reply.


I just like how lightweight sumatra is and its worth the trade off with some other features I like.


Thanks for the link I have everything checked so I think its Sumatra itself.


Is it possible to have a diff default outlook previewer but keep sumatra is main default overall?


Previewer aside is it possible for a VBA solution as often I want to open the attachment to work on rather than just preview?


Thanks
Reply With Quote
  #4  
Old 07-15-2021, 04:47 AM
gmayor's Avatar
gmayor gmayor is offline Open attachment shortcut Windows 10 Open attachment shortcut Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Lightweight because half the useful functions are missing?
I don't know what its capability is, but the following will save the PDFs from a selected message to a named folder, which will be created if it doesn't exist.


Code:
Option Explicit

Sub GetPDFAttachments()
Dim olMsg As MailItem
    'On Error Resume Next
    Select Case Outlook.Application.ActiveWindow.Class
        Case olInspector
            Set olMsg = ActiveInspector.currentItem
        Case olExplorer
            Set olMsg = Application.ActiveExplorer.Selection.Item(1)
    End Select
    SaveAttachments olMsg
lbl_Exit:
    Exit Sub
End Sub

Private Sub SaveAttachments(olItem As MailItem)
'Graham Mayor - http://www.gmayor.com - Last updated - 26 May 2017
Dim olAttach As Attachment
Dim strFname As String
Dim strExt As String
Dim j As Long
Const strSaveFldr As String = "C:\Attachments\"

    CreateFolders strSaveFldr
    On Error Resume Next
    If olItem.Attachments.Count > 0 Then
        For j = 1 To olItem.Attachments.Count
            Set olAttach = olItem.Attachments(j)
            If olAttach.FileName Like "*.pdf" Then
                strFname = olAttach.FileName
                olAttach.SaveAsFile strSaveFldr & strFname
            End If
        Next j
        olItem.Save
    End If
lbl_Exit:
    Set olAttach = Nothing
    Set olItem = Nothing
    Exit Sub
End Sub

Private Function FolderExists(fldr) As Boolean
'An Outlook macro by Graham Mayor
Dim FSO As Object
    Set FSO = CreateObject("Scripting.FileSystemObject")
    If (FSO.FolderExists(fldr)) Then
        FolderExists = True
    Else
        FolderExists = False
    End If
lbl_Exit:
    Exit Function
End Function

Private Function CreateFolders(strPath As String)
'An Outlook macro by Graham Mayor
Dim strTempPath As String
Dim lngPath As Long
Dim VPath As Variant
    VPath = Split(strPath, "\")
    strPath = VPath(0) & "\"
    For lngPath = 1 To UBound(VPath)
        strPath = strPath & VPath(lngPath) & "\"
        If Not FolderExists(strPath) Then MkDir strPath
    Next lngPath
lbl_Exit:
    Exit Function
End Function
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #5  
Old 07-15-2021, 04:50 AM
gazmoz17 gazmoz17 is offline Open attachment shortcut Windows 7 64bit Open attachment shortcut Office 2016
Novice
Open attachment shortcut
 
Join Date: Oct 2019
Posts: 6
gazmoz17 is on a distinguished road
Default

Haha your prob right but I dont use half the features of other more comprehensive pdf editors and they seem to lag just opening proper preview aside.


Thanks mate I'll have a play with the code
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open archived attachment files, Outlook web app Dmeedom Outlook 0 05-31-2017 08:10 AM
Open attachment shortcut Cannot open DOC email attachment will only save as DOCx which I also cannot open Batty Word 8 08-01-2014 03:24 AM
Open attachment shortcut Couldn't open office attachment isminoh Office 3 10-22-2012 02:50 AM
how to open an email and see the attachment there too? waltdisneypixar Outlook 0 06-17-2012 02:38 PM
Word attachment on an E-mail-macro to open attachment & nablady Outlook 0 11-28-2006 03:00 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:10 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft