Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-02-2015, 04:52 AM
AndyDDUK AndyDDUK is offline Outlook VBA to open a windows folder Windows 7 64bit Outlook VBA to open a windows folder Office 2010 64bit
Advanced Beginner
Outlook VBA to open a windows folder
 
Join Date: Oct 2012
Posts: 32
AndyDDUK is on a distinguished road
Default Outlook VBA to open a windows folder

Hi

I'm using Office 2013

What is the Outlook VBA code I need to open a windows folder? (preferably the VBA will check the folder is not already open)

Many thanks



Andy
Reply With Quote
  #2  
Old 11-02-2015, 06:08 AM
gmayor's Avatar
gmayor gmayor is offline Outlook VBA to open a windows folder Windows 7 64bit Outlook VBA to open a windows folder Office 2010 32bit
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

'Open' it for what purpose?
__________________
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 11-02-2015, 07:38 AM
AndyDDUK AndyDDUK is offline Outlook VBA to open a windows folder Windows 7 64bit Outlook VBA to open a windows folder Office 2010 64bit
Advanced Beginner
Outlook VBA to open a windows folder
 
Join Date: Oct 2012
Posts: 32
AndyDDUK is on a distinguished road
Default

Hi Graham, I have the Outlook VBA code that saves my email attachments to a particular folder eg C:\OutlookAttachments

Now I want to add to that code so the last thing it does is to open up the location of where the files are saved, in this example to open "C:\OutlookAttachments"

Or better still a message box - "Do you want to open the folder..?- yes or no?


Do you know how to do this?

I have office 2013 and win 7 FYI

Thanks

Andy
Reply With Quote
  #4  
Old 11-03-2015, 02:07 AM
gmayor's Avatar
gmayor gmayor is offline Outlook VBA to open a windows folder Windows 7 64bit Outlook VBA to open a windows folder Office 2010 32bit
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

OK, you need a simple function to open Windows Explorer e.g.
Code:
Sub OpenAtFolder(strPath As String)
    Shell "cmd /C start """" /max """ & strPath & """", vbHide
lbl_Exit:
    Exit Sub
End Sub
and you can call it from your code e.g.
Code:
    If MsgBox("Do you want to open the folder..?", vbYesNo) = vbYes Then
        OpenAtFolder "C:\OutlookAttachments\"
    End If
__________________
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
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2010: Saving attachments opens up wrong windows folder to save in jeroen Outlook 0 09-29-2015 01:51 AM
Outlook VBA to open a windows folder How to open Documents folder directly from CTRL+O of Open folder on QAT scvjudy Word 2 08-11-2014 10:58 PM
Cannot open folder in Outlook marketshare Outlook 0 03-17-2013 04:07 PM
Outlook VBA to open a windows folder Outlook slow to open folder rtankersley Outlook 1 09-16-2008 05:42 AM
Programatically open Outlook folder (set focus) using RDO? NicMic Outlook 0 01-10-2008 03:27 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:30 PM.


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