Jun 8th, 2006, 06:34 PM
#1
[RESOLVED] Looking for help with an Outlook macro
Well actually I'm looking for someone to write it for me and explain how to implement it.
What I'd like it to do when I press Ctrl-P is
Look in my Inbox for an email with "Results for PokerStars Tournament" in the title Mark it as read Move it to an existing Outlook folder named "Poker Stars Wins"
If it matters, I'm using Outlook 2002.
Jun 9th, 2006, 08:03 AM
#2
Fanatic Member
Re: Looking for help with an Outlook macro
Martin,
Why don't you use the built in Rules Wizard to do all of this for you, you then just need a macro to run the rule ?
Bob
"I dislike 7 am. If 7 am were a person, I would punch 7 am in the biscuits." -
Paul Ryan ,
DailyRamblings
Jun 16th, 2006, 10:59 AM
#3
Re: Looking for help with an Outlook macro
OK, that's a good idea but unfortunately I have no experience in actually writing Outlook macros so I still would appreciate help with that.
Jun 16th, 2006, 11:05 AM
#4
Re: Looking for help with an Outlook macro
You don't need a macro to run a rule, just set up the rule, as per thje example below and turn it on.
Attached Images
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful
Jun 16th, 2006, 11:06 AM
#5
Re: Looking for help with an Outlook macro
Martin, doesn the destination folder reside at the top level folder or is it a subfolder under the Inbox or such?
Almost done...
Edit: but the rule wont run by Ctl+P unless Martin wants to change it to automatic?
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Jun 16th, 2006, 11:12 AM
#6
Re: Looking for help with an Outlook macro
Ok,assuming that the destination folder is at the same folder level as the Inbox... just add RegisterHotkey API code to invoke the procedure behind Outlook VBA (Press Alt+F11). If you dont want the hotkey then I can add code to add a menu item in Outlook or a toolbar button. Let me know.
VB Code:
Option Explicit
'Behind Outlook VBA ThisOutlookSession
Private Sub MarkMovePokerEmails()
Dim oInbox As Outlook.MAPIFolder
Dim oEmail As Outlook.MailItem
Dim oPoker As Outlook.MAPIFolder
Dim i As Integer
Set oInbox = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
Set oPoker = Application.GetNamespace("MAPI").Folders("Poker Stars Wins")
'loop backwards to catch any current incoming emails
For i = oInbox.Items.Count To 1
If InStr(1, oInbox.Items.Item(i).Subject, "Results for PokerStars Tournament") > 0 Then
Set oEmail = oInbox.Items.Item(i)
oEmail.UnRead = False
oEmail.Save
oEmail.Move oPoker
Set oEmail = Nothing
DoEvents
End If
Next
Set oPoker = Nothing
Set oInbox = Nothing
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Jun 16th, 2006, 02:27 PM
#7
Re: Looking for help with an Outlook macro
Originally Posted by
DKenny
You don't need a macro to run a rule, just set up the rule, as per thje example below and turn it on.
Thanks. I've created it and as soon as I get a chance to play some poker I'll see if it works but I'm sure it will.
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width