A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

VBA Editor Keeps Opening On Its Own-Outlook 07



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 15th 08, 12:18 PM posted to microsoft.public.outlook.program_vba
Dave_V
external usenet poster
 
Posts: 1
Default VBA Editor Keeps Opening On Its Own-Outlook 07

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 03:36 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.