![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I've created a script that automatically saves attachments to a specified
folder, using the date portion of the ReceivedTime to name the attachment (the email arrives daily with the attachment always titled "mail.rtf" I've setup a rule to run this script when the appropriate email arrives. It works beautifully. However, since I started utilizing this script, the VBA editor will open on its own. It happens throughout the day, not necessarily when the email arrives that triggers the script (that comes at 7:45am, but the VBA window pops up numerous times during the day). I notice that when it popsup on it's own, it doesn't have the full interface -- things like the menu and toolbars at the top aren't displayed. Any ideas why this is happening, and how to stop it? Here is the script: Sub SaveBAIFileAttachmentsToDisk(olkMessage As Outlook.MailItem) Dim olkAttachment As Outlook.Attachment, _ objFSO As Object, _ strRootFolderPath As String, _ strFilename As String 'Change the path on the following line to the folder you want the attachments save in strRootFolderPath = "C:\attachments\Daily BAI File Archive\" Set objFSO = CreateObject("Scripting.FileSystemObject") Set olkSourceFolder = Application.ActiveExplorer.CurrentFolder If olkMessage.Attachments.Count 0 Then For Each olkAttachment In olkMessage.Attachments 'build the filename based on the date strFilename = Format(olkMessage.ReceivedTime, "yyyy-mm-dd") & ".rtf" intCount = 0 Do While True If objFSO.FileExists(strRootFolderPath & strFilename) Then intCount = intCount + 1 strFilename = "Copy (" & intCount & ") of " & strFilename Else Exit Do End If Loop olkAttachment.SaveAsFile strRootFolderPath & strFilename Next End If Set objFSO = Nothing Set olkAttachment = Nothing Set olkMessage = Nothing End Sub |
Ads |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlook Macro for Opening Reuters, Opening Excel File, Send Email | Tsp245 | Outlook and VBA | 1 | August 13th 08 08:27 PM |
Using Word XP as editor with Outlook 2k3 | David B.[_3_] | Outlook - General Queries | 2 | April 14th 08 10:18 PM |
using outlook with word set as editor | Dawn | Add-ins for Outlook | 1 | April 17th 07 02:53 PM |
Outlook Editor 2003 | AIANDAS | Outlook - General Queries | 4 | September 26th 06 12:34 AM |
Use 3rd Party Editor in Outlook not Word or Built in Editor | Charles | Outlook - Installation | 1 | March 28th 06 03:32 PM |