Outlook:VBA#1 [How to move older mails to archive folders using code]
Private Sub Application_Startup()
Dim objOutlook As Outlook.Application
Dim objInboxFolder As Outlook.MAPIFolder
Dim myNewFolder As Outlook.Folder
Dim objNamespace As Outlook.NameSpace
Set objOutlook = Application
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objInboxFolder = objNamespace.GetDefaultFolder(olFolderInbox)
Set newFolder = objInboxFolder.Folders.Add("Test-Archived-Jan2014")
Dim movedItemCount As Long
For intCount = objInboxFolder.Items.Count To 1 Step -1
Set objVariant = objInboxFolder.Items.Item(intCount)
DoEvents
If objVariant.Class = olMail Then
intDateDiff = DateDiff("d", objVariant.SentOn, Now)
If intDateDiff > 10 Then
' Set objArchiveFolder = objNamespace.Folders("maheshk@keepmovin.com"). _
' Folders("Inbox").Folders("Old")
objVariant.Move newFolder
movedItemCount = movedItemCount + 1
Set objArchiveFolder = Nothing
End If
End If
Next
MsgBox "Done, archived:#" & movedItemCount
End Sub
Design scenarios from – .NET Technology Guide for Business Applications.pdf
I highly recommend this pdf for anyone who is looking for design guide in .NET.
Note: It also talks about Silverlight scope, migration & suggestions. Get one from here – http://www.microsoft.com/net/nettechnologyguidance
How to attach Visual studio dynamically
I never thought this would be so easy with this couple of statements. All these days, I used to put a hard coded message box thrown up and then try to attach manually VS by selecting that new process. But this one is very useful if you want to do automatically break in VS.
if (!Debugger.IsAttached)
Debugger.Launch();
Debugger.Break();
This would be useful if you are debugging multiple process in the Visual Studio – Ley say you HelloWorld.exe is creating a new exe LogViewer.exe and yourself want to debug end to end all in same VS. More at MSDN- http://goo.gl/lKJcUh
-
Recent
- The ID token is not yet valid. Make sure your computer’s time and time zone are both correct. Current epoch = 1689517128
- .NET Core – How to create a .NET GUI app which runs across the platform
- AKS 2022 updates
- Linux firewall and connectivity issues
- Microsoft Ignite (Sep22-24) event recap & On-demand sessions
- [Linux] Steps to install and configure sysstat package for monitoring.
- Azure Security Enablement – Centralized place for all the links
- Presenting tech session with stories [linkedin learning notes]
- gRPC using .NET core notes
- .NET in 2020 (Build recap)
- #KubeCon CNCF – North America 2019 watchlist
- AKS CLI Sheetcheat for the labs
-
Links
You must be logged in to post a comment.