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 Keeps popping up?



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old November 3rd 06, 10:12 AM posted to microsoft.public.outlook.program_vba
PaulW
external usenet poster
 
Posts: 1
Default VBA Keeps popping up?

Hi there, i've set up a macro in Outlook to save some attachments. But the
code keeps coming up on screen, not when I run it, but randomly while i'm
working on other things.

It mostly seems to appear on my screen when the screen saver is activated,
anyone know why? and/or how I can stop it?

Sub GetAttachments()
' This Outlook macro checks a the Outlook Inbox for messages
' with attached files (of any type) and saves them to disk.
' NOTE: make sure the specified save folder exists before
' running the macro.
' Declare variables
Dim ns As NameSpace
Dim Inbox As MAPIFolder
Dim Item As Object
Dim Atmt As Attachment
Dim FileName As String
Dim i As Integer
Set ns = GetNamespace("MAPI")
Set Inbox = ns.GetDefaultFolder(olFolderInbox)
i = 0
' Check each message for attachments
For Each Item In Inbox.Items
' Save any attachments found
For Each Atmt In Item.Attachments
' This path must exist! Change folder name as necessary.
FileName = "S:\Close Assistance\Main Files\Download
Reports\Telephone Calls\Pre Visit Reports\" & Format(Item.CreationTime,
"dd-mm-yy ") & Atmt.FileName
If Item.SenderName = "Power Desk" Then
Atmt.SaveAsFile FileName
End If
i = i + 1
Next Atmt
Next Item
' Clear memory
GetAttachments_exit:
Set Atmt = Nothing
Set Item = Nothing
Set ns = Nothing
Exit Sub

End Sub
 




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
My appointments are not popping up. Anyone know how to fix this? bulto Outlook - Calandaring 3 November 2nd 06 08:41 PM
outlook keeps popping up every 15 seconds when in other programs Omazanne Outlook - General Queries 1 July 24th 06 05:49 PM
Reminder not popping up Jack Outlook - Calandaring 2 June 20th 06 10:04 PM
Recurrence popping up SP Outlook - Calandaring 0 May 8th 06 02:05 PM
Reminders keep Popping Up after Dismissing ckulow Outlook - Calandaring 1 January 14th 06 03:16 AM


All times are GMT +1. The time now is 07:01 AM.


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.