![]() |
|
|
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
||||
|
||||
|
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 |
|
#5
|
|||
|
|||
|
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
|
|
|
|
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 |
Cannot open DOC email attachment will only save as DOCx which I also cannot open
|
Batty | Word | 8 | 08-01-2014 03:24 AM |
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 |