« first day (628 days earlier)      last day (2552 days later) » 
00:00 - 22:0022:00 - 23:00

12:01 AM
RELOAD!
[Hosch250/Rubberduck] 2 commits. 223 additions. 76 deletions.
[retailcoder/Rubberduck] 5 commits. 77 additions. 239 deletions.
[rubberduck-vba/Rubberduck] 12 commits. 1 closed issue. 7 issue comments. 111235 additions. 111652 deletions.
[Vannevelj/VSDiagnostics] 2 commits. 11 additions. 10 deletions.
[Vogel612/TranslationHelper\‌​] 1 commit. 17 additions. 7 deletions.
[Zomis/Machine-Learning] 5 commits. 1 opened issue. 474 additions. 59 deletions.
 
12:13 AM
Working.
 
12:36 AM
@ThunderFrame aaah, so that's how!!! We're not handling them yet :-)
That will solve so many problems!!
 
1:27 AM
@Mat'sMug @RubberDuck.
 
@Hosch250 why are they stacked like that? Isn't it a WrapPanel?
 
No, it is a StackPanel.
What would a WrapPanel look like?
 
Same as the top one, and then same as bottom one when the window is shrinked in width
 
@Mat'sMug I think the Merge Button would be on the previous line...
why not set minimum Dimensions?
 
@Vogel612 because the toolwindow can be sized to ridiculous sizes anyway
 
1:36 AM
@Mat'sMug that isn't really a good reason...
 
OK, why don't I use a WrapPanel?
First, because I hadn't heard about them until just now.
Second, because I need to animate the margins to make them look good both ways.
 
^^ see that's how good reasons work @Mat'sMug
:)
 
lol
 
Take your pick.
What I really should do is leave both and let the users use the one they want.
 
I still think LinkButtons would look nice (nicer?)
 
1:45 AM
no what you really should do is define a minimum width so they don't wrap...
 
Hi, @MattHanson.
@Vogel612 Nah.
@Mat'sMug I don't really.
 
@Vogel612 the user can still shrink the window smaller than minsize
 
that's stupid. Not by you, but for WPF
no wait... that's XAML, right?
 
It's hosted in a docked toolwindow, it's COM that's stupid
 
WPF allows you to set the min width.
OK, take your pick and make it fast.
 
1:49 AM
You could still set a min size for the control, but you can't control the host window
@Hosch250 whatever
 
I'm for the lower... unless you can enforce non-wrapping...
 
Just please not vertically stacked by default
 
I think I'm for the lower too, after all this time I spent on the visual states.
@Mat'sMug No, no way.
 
[Hosch250/Rubberduck] Hosch250 pushed commit e967dd85 to BugBlipper: WrapPanel buttons
[Hosch250/Rubberduck] Hosch250 pushed commit 2ccf7504 to BugBlipper: Remove unnecessary name
 
@Hosch250 @Vogel612 ^^^
 
1:55 AM
seen... seems like a really problematic "framework" to work UI in...
 
2:11 AM
To be clear: a WPF window does not do that
That's a WPF UserControl hosted in a WinForms WPF interop host control, itself in a WinForms UserControl, itself hosted in a COM window
...we do what we can ;-)
 
And hope no user is that stupid.
@Mat'sMug Can you give me a screenshot of Source Control Unsynced commits in action?
 
huh?
 
NVM, I think I can get it easily myself.
 
is the UI all wired up?
 
[Hosch250/Rubberduck] Hosch250 pushed commit d91f9f66 to BugBlipper: Unsynced commits view
 
2:17 AM
Nope.
Just the UI is done at this point.
 
Merge pull request #1137 from rubberduck-vba/CodeExplorer

adding ParentScoping and ParentNonScoping members to IdentifierRefereā€¦
 
ok
 
[retailcoder/Rubberduck] autoboosh pushed commit 8f6f40e1 to CodeExplorer: fix operator precedence
[retailcoder/Rubberduck] autoboosh pushed commit 94ef8f7e to CodeExplorer: readd accidentally deleted changelog line
Merge pull request #1140 from autoboosh/precedencefix

fix operator precedence
 
OK, do you have any VBE projects set up with source control at the moment?
 
Merge pull request #49 from rubberduck-vba/next

sync with merged PR's in main repo
 
2:18 AM
It will be a real pain for me to revert to try to get what I want.
 
not sure what you mean
 
I just want a screenshot of the Unsynced Commits view with a project connected to source control.
Like, it can't just be a default project, it has to be a real one connected to Git.
 
I haven't even tried using it :/
I need a user manual :)
 
It should just work. Go create a repo for me, please.
Just go click the New Repo button and give it a name.
 
hold on, building
 
2:20 AM
Wait a sec, you didn't just pull my changes, did you?
 
I pulled autoboosh's
 
DON'T PULL FROM ME!
OK.
 
he fixed operator precedence in the grammar
 
OK, great.
 
not that it affects parsing in any way, but it will make life easier when we try to evaluate If conditions
not sure how relevant the Id is
 
2:24 AM
@Mat'sMug that seems to be the commit hash...
 
can we not just show the first 8 digits, like GitHub does?
 
how relevant for the user?.. depends. You could get away with the shortening
 
for display at least
 
internally you have to keep the full hash, though.
else you may actually run into problems with huge versioning histories and the first 8 digits not being unique
I've had it happen to me on a project with something like 5 years worth of commits....
 
I mean, for displaying in the UI
 
2:26 AM
OK, great.
 
it's surprising that creating the repo makes the initial commit automatically
 
That's how it works on GH, too
 
hmm
 
even with a git init you get an initial commit IIRC
 
ok then
 
2:27 AM
I HATE MERGE CONFLICTS!!!
 
@Hosch250 MERGE SOONER!
 
Trouble is, @Mat'sMug didn't pull my changes before he fixed things.
And we fixed things differently, so now we have merge conflicts.
 
so, the [Unsynced commits] tab should get activated automatically after creating the repo
 
Alluding to Trundle: "IF YOU WANT ME TO CONFLICT LESS, MERGE SOONER!!"
 
@Hosch250 like what?
 
2:28 AM
In the inspections.
 
uhm... I hit "push" and I get a VS "Find Source: NetworkExtensions.cs" dialog
it's looking in c:\projects\libgit2sharp\LibGit2Sharp\NetworkExtensions.cs
wtf?
 
I've never seen that.
 
I hit cancel, and then I have a LibGit2SharpException on _repo.Network.Push(branch, options);
 
Huh.
 
> The branch 'master' (\"refs/heads/master\") that you are trying to push does not track an upstream branch.
 
2:32 AM
Yeah, yeah, I thought that was fixed...
You need to connect it to a remote repo.
Forgot how ATM, will work better in my new one.
 
@Hosch250 you need to set the image size to 16 explicitly
 
It is.
 
@Hosch250 or something posing as remote
@Mat'sMug you can test pushing locally by getting into a separate folder.
run git init --bare there
 
Some images take up more room in the actual image than others.
 
no
they're all 16x16 icons
fetch, push and sync are not sized
 
2:33 AM
then nav back to the repo you want to fix and git remote add origin "file://path/to/folder"
 
they're stretched
@Vogel612 yeah, nice UX
 
that's the test-setup so you don't need an actual remote
so no github or bitbucket repos
no remote repos at all, actually
 
I would expect the thing to push to a local repo if no remote is set up
no need for CLI fiddling
 
It should.
I don't know what happened.
 
that "find source" thing was just weird
 
2:35 AM
@Mat'sMug but where would that local repo be??
 
I have the size explicitly set. I don't know what is happening.
 
where I created it when I clicked the "new repo" button?
 
you can't just point a firehose somewhere, just because someone forgot to set up a canal
@Mat'sMug that's your local repo
the changes are in there when you commited them
also the file repo fiddling is setting up a remote repo
that remote just happens to be sitting on your PC, too
but for all intents and purposes it's a "remote"
 
so, "push" should either work, or be disabled
 
correct
 
2:37 AM
Oh, it was a margin thing.
 
@Hosch250 I was about to ask you to give me the xaml
 
[Hosch250/Rubberduck] Hosch250 pushed commit 82669c86 to BugBlipper: Fix a couple things
 
I accidentally had "5" instead of "5,0"
 
@Mat'sMug see also: #545
 
oh
well that explains it
sort of
I still don't get the "find source" thing prompting me for a .cs source file in the LibGit2Sharp project
 
2:40 AM
now that's a whole different set of problems
are you breaking on exception?
 
@Mat'sMug Was your project saved?
 
yes
oh
yes
 
Oh.
 
I loaded an existing workbook
 
Oh well, don't worry about it. It shouldn't have happened, but it is becoming obsolete as we speak.
 
2:41 AM
 
okay the break on exception gets you into the LibGit2Sharp cs files, I assume the missing remote only blows up there
 
@Vogel612 I've never seen that happen in a compiled dll
 
@Mat'sMug happened to me all the time in java (running eclipse)... IntelliJ just goes ahead and decompiles the .class files :D
anyways I'm off for bed. Desperately need sleep
 
night!
 
Oh and you may want to check with the new feed in the 2nd.
It could use a name other than Stack Exchange
 
2:57 AM
[retailcoder/Rubberduck] retailcoder pushed commit 1a0c3d62 to CodeExplorer: fixed double-parse startup issue (ref #1033)
[retailcoder/Rubberduck] retailcoder pushed commit 8145e792 to CodeExplorer: removed deprecated VBProjectParseResult class
[Hosch250/Rubberduck] Hosch250 pushed commit eb974da9 to BugBlipper: Settings view done.
 
I guess I just have to create the VM's and wire things up now.
 
3:36 AM
I found this blog post which would be right in Rubberduck territory. It is about using interfaces in VBA. mikejuniperhill.blogspot.com.au/2013/05/…
 
@AndrewM nice post!
seen this?
15
Q: Extensible logging

Mat's MugWhenever I need logging functionality in .net, I use a logging framework, such as NLog. Obviously there's no logging framework for vba, at least none that I know of. As much as I love using NLog, the way it works, with targets, rules and loggers, was going to be way too heavy and complex for my ...

interfaces in VBA are definitely under-used. I bet half the people claiming VBA can't do OOP don't even know you can implement interfaces in VBA
 
4:17 AM
0
Q: How to hook up a COM event dispatcher?

Mat's MugThe VBIDE API exposes the wonderfully cryptic _dispVBComponentsEvents interface (among others), which look like something that I could use to capture various interesting events in the VBE. So I implemented the interface in a class that intends to capture the event and raise a "normal" .net event...

 
4:31 AM
> MSDN is completely useless on the subject, and finding documentation about this is harder than finding the maiden name of the third wife of Henry VIII.
 
4:56 AM
@ThunderFrame this is serious COM stuff. if you can find documentation about how to implement a callback for an IDispatch in C# I'll definitely dig deeper into it... but I'm missing lots of low-level COM knowledge to make this work
 
5:18 AM
nevermind
this is going to work :)
I need to blog about this
now the question is, how do I manage all the IConnectionPoint instances
I need some IDictionary<IConnectionPoint, int>
 
6:10 AM
[retailcoder/Rubberduck] retailcoder pushed commit 5d19c44b to CodeExplorer: implemented dispatchers for VBProjects and VBComponents events. needs refactoring and further fine-tuning, but works.
> Code Explorer still shows components that were supposedly removed, so RubberduckParserState.ClearDeclarations(VBComponent) and perhaps also RubberduckParserState.ClearDeclarations(VBProject) might not be working as intended (the tree view needs to be refreshed anyway, but then the component and its members remains there so something isn't right).
[rubberduck-vba/Rubberduck] build for commit 5d19c44b on unknown branch: AppVeyor build succeeded
> Upon further testing, the declarations do get correctly removed from the parser state - the problem seems to only be with the Code Explorer tree view.
Merge pull request #49 from rubberduck-vba/next

sync with merged PR's in main repo
[rubberduck-vba/Rubberduck] retailcoder pushed commit 1a0c3d62 to CodeExplorer‌​: fixed double-parse startup issue (ref #1033)
[rubberduck-vba/Rubberduck] retailcoder pushed commit 8145e792 to CodeExplorer‌​: removed deprecated VBProjectParseResult class
[rubberduck-vba/Rubberduck] retailcoder pushed commit 5d19c44b to CodeExplorer‌​: implemented dispatchers for VBProjects and VBComponents events. needs refactoring and further fine-tuning, but works.
Merge pull request #1141 from retailcoder/CodeExplorer

Handle VBProjects and VBComponents COM events
 
TTGTB
 
Night.
 
[rubberduck-vba/Rubberduck] build for commit 151bfad4 on CodeExplorer: AppVeyor build succeeded
 
6:48 AM
COM events.... From Ahhh, that's how they work to commit, in 6 hours!
 
 
2 hours later…
9:01 AM
> I mean, Rubberduck scripting extensions, written in VBA itself (but not restricted to), having access to ANTLR parse tree, for example.

Just an idea.
 
9:57 AM
> Sounds related to #404.

There's also an issue somewhere about exposing the parser via a COM interface so that we could access the parse tree and symbol table from VBA.

In short, yes, it's possible, but a pretty large undertaking.
 
10:36 AM
> There should be a default mapping, but we should absolutely make the mappings user-configurable.
 
11:15 AM
> I recall seeing references to key hooks, presumably to catch keyboard shortcuts, but also to capture edits to a module and/or changes to the current text selection.
While key hooks will need to be the approach for keyboard shortcuts, there are a number of downsides to keyhooks for tracking code and selection changes:

1. Code edits can be performed without keystrokes (eg. Copy/Paste, Mouse-drag, Event handlers, interface implementations, Replace/Replace All, VBE and 3rd party addins, etc)
 
 
1 hour later…
12:25 PM
0
Q: Retrieves Data From Various Excel Sheets Online, sorts, edits, and Analyzes said Data

StormsEdgeThanks in advance! I'm fairly new to Excel VBA so I welcome all criticism and advice! This is a routine I wrote to streamline analysis I need to do that originally took 1.5 hours and now takes about 4 minutes total run time. I'm fairly certain this part of stack is for code review, but if this...

 
@ThunderFrame actually it went from there to "crap, that's just the VBIDE API interfaces being redone, there's nothing useful here" to "I can't do this" to "there's gotta be a way" to intense Googling, to "I gotta ask on SO" to intense Googling, to "oh wow, I was so close" to "IT WORKS!!!" to commit ;-)
 
12:45 PM
interesting docs behind that original github link... netoffice.codeplex.com/wikipage?title=Tec_Documentation_English
 
 
1 hour later…
2:14 PM
> I don't think we'll expose the ANTLR parse tree itself. But, we can (and eventually, *will*) expose a "reflection API" so that `Declaration` and `IdentifierReference` objects can be browsed/iterated in VBA client code - the API could also expose parser state events to notify clients of a change.

That API is a project all by itself though.
 
2:47 PM
0
A: How to hook up a COM event dispatcher?

Mat's Mug Am I on the right track? Yes. What you have in an event sink - you're missing a bit of code to register the sink with the COM servers. The VBProjects and VBComponents interfaces implement (somewhere very deep) the IConnectionPointContainer interface - you need to use that to collect IConnec...

 
3:39 PM
> I just tried the latest commit and see a lot of RuntimeBinder Exceptions, like these:

`Exception thrown: 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' in System.Core.dll
("'Rubberduck.Parsing.Grammar.VBAParser.ConstSubStmtContext' does not contain a definition for 'LPAREN'")`
[rubberduck-vba/Rubberduck] build for commit 151bfad4 on next: AppVeyor build cancelled
BUILD FAILURE!
Merge pull request #1144 from rubberduck-vba/CodeExplorer

merge latest changes
> @Pitterling that's my bad - I merged from my fork into the CodeExplorer branch - I intended to merge into Next... merged now, please pull the changes... when the DeclarationType is DeclarationType.Const the IsArray getter shouldn't even try to access the ParserRuleContext anymore.
[rubberduck-vba/Rubberduck] build for commit 6dd9e37b on next: AppVeyor build succeeded
 
 
2 hours later…
5:18 PM
> Hi, during parsing i'm facing several exception throws. They always look like this:

> Exception thrown: 'System.InvalidOperationException' in System.Core.dll
Exception thrown resolving 'vbFnPivotItemPri': System.InvalidOperationException: Sequence contains more than one matching element
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
at Rubberduck.Parsing.Symbols.IdentifierReferenceResolver.Resolve(ICS_B_MemberProcedureCallContext context)
> Thank you for the bug report. Could you provide the failing code so we could see exactly what our parser breaks on?
> That's a resolver bug - I *think* I've seen it too, but I can use some help coming up with the minimal VBA code required to cause it. The exception is thrown on [this line](https://github.com/rubberduck-vba/Rubberduck/blob/next/Rubberduck.Parsing/Symbols/IdentifierReferenceResolver.cs#L731):

var identifierContext = context.ambiguousIdentifier();
var member = _declarations.Where(d => d.IdentifierName == identifierContext.GetText())
.SingleOrDefault(i
 
5:49 PM
> @Hosch250 would it be sufficient just to provide the failing module? There are a lot of dependencies ..
Any way to figure out .. which part the parser is failing?
> A minimal, verifiable example would be best.
 
6:09 PM
> I *think* this would trip it:

**Class1**

Private Type TSomething
Foo As Integer
End Type
Private this As TSomething

Public Property Get Foo() As Integer
Foo = this.Foo
End Sub

The identifier `Foo` exists twice in the module - once under `TSomething.Foo`, and once under `Class1.Foo`. Since all the `Where` call is checking for is that the `parentType.ComponentName` ("Class1") matches, and that the `identifierName` ("Foo") matches - the `Single
> @Hosch250
[Rubberduck-Parser-Error.xlsm.zip](https://github.com/rubberduck-vba/Rubberduck/files/145178/Rubberduck-Parser-Error.xlsm.zip)

I extraced the failing part and the dependencies .. in total more then 20 modules ...
> Thanks. We will look into it.
 
yet I'm pretty sure I can repro the problem with less than 10 lines of code
 
6:34 PM
Well, you can fix your problem and see if the fix works for his.
 
> @retailcoder the code snippet is causing a different exception

``Exception thrown: 'Rubberduck.Parsing.Symbols.SyntaxErrorException' in Rubberduck.Parsing.dll
Rubberduck.Parsing.Symbols.SyntaxErrorException: extraneous input 'End Sub' expecting {END_PROPERTY, NEWLINE, REMCOMMENT, COMMENT, ':', WS}
at Rubberduck.Parsing.Symbols.ExceptionErrorListener.SyntaxError(IRecognizer recognizer, IToken offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException e) in C
 
6:49 PM
oh come on
 
> lol, that was a typo. I meant to End Property, not End Sub!
 
There's gotta be a better way of doing this...
'Items containing specific senders:
If InStr(item.SenderName, "partnerlinksupport") > 0 _
Or InStr(item.SenderName, "SQLAdmin") > 0 Then
    'Containing containing specific recipients:
    If InStr(item.Recipients, "intdev-all") > 0 Then
        'Containing specific words in subject line:
        If InStr(item.Subject, "error") > 0 _
        Or InStr(item.Subject, "exception") > 0 Then
            item.UnRead = False
            item.Move destFolder
        End If
    End If
End If
 
guard-clauses and connecting the nested ifs through Ands
that's the two possiblities.
 
Guard clauses?
 
Turn the If-Conditions around and return in case they don't apply
see also [flattening arrow code(blog.codinghorror.com/flattening-arrow-code)
 
7:04 PM
I could also use GoTo :D
(just kidding)
 
7:14 PM
'First skip items do Do Not meet the criteria:
If Not InStr(item.SenderName, "partnerlinksupport") > 0 _
Or Not InStr(item.SenderName, "SQLAdmin") > 0 _
And Not InStr(item.Recipients, "intdev-all") > 0 _
And Not InStr(item.Subject, "error") > 0 _
Or Not InStr(item.Subject, "exception") > 0 _
Then
    'Do nothing
Else
    item.UnRead = False
    item.Move destFolder
End If
Better?
 
'Do nothing
smells
 
What's a better alternative?
 
reverse the condition and do something instead?
 
:|
Read up^
15 mins ago, by Vogel612
Turn the If-Conditions around and return in case they don't apply
 
If InStr(item.SenderName, "partnerlinksupport") > 0 _
And InStr(item.SenderName, "SQLAdmin") > 0 _
Or InStr(item.Recipients, "intdev-all") > 0 _
Or InStr(item.Subject, "error") > 0 _
And InStr(item.Subject, "exception") > 0 _
Then
    item.UnRead = False
    item.Move destFolder
End If
 
7:17 PM
Ah ok, sure
 
you might want to extract a function to clarify what that condition does
 
Would this make sense for exceptions to the rules:
'First check items that meet some criteria:
If InStr(item.SenderName, "partnerlinksupport") > 0 _
Or InStr(item.SenderName, "SQLAdmin") > 0 _
And InStr(item.Recipients, "intdev-all") > 0 _
And InStr(item.Subject, "error") > 0 _
Or InStr(item.Subject, "exception") > 0 _
Then
    'Exceptions here:
    If Not InStr(item.Subject, "QueryDatabases - Supplies Check") > 0 _
    Then
        item.UnRead = False
        item.Move destFolder
    End If
End If
@Mat'sMug If I did that, would I need to copy all this boilerplate into the function too?
Dim nameSpace As Outlook.nameSpace
Dim inbox As Outlook.Folder
Dim destFolder As Outlook.Folder
Set nameSpace = Application.GetNamespace("MAPI")
Set inbox = nameSpace.GetDefaultFolder(olFolderInbox)
Set destFolder = inbox.Folders("_ErrorDump")
 
copy? or move?
 
Hm, maybe it is move, not sure
My Sub signature now is Sub MoveToErrorDump(item As Outlook.mailItem), then the boilerplate, then the If conditions
 
only item would be needed it seems, though
 
7:28 PM
And for Pete's sake, indent those conditions so I can see where the If condition starts and ends.
 
Is Sub == function?
 
sort of
 
NO.
Sub is sort of like a void in Java. Function's return a value.
 
a Sub is a procedure without a return value (aka void)
a Function is a procedure with a return value
 
OK. I wouldn't need a return value if it's just marking an item unread and moving it then
Good to know, I had no idea of the distinction (though I knew functions usually return something, from writing a bit of JS)
 
7:30 PM
right. but what I meant was Private Function GoodNameHere(ByVal item As MailItem) As Boolean
yeah.. you gotta understand where it came from, to understand why it's called that way
 
@Mat'sMug Should we release an inspection to warn of empty procedure/property/if/loop blocks with 2.0?
 
I was just gonna do Sub HandleErrorMailItem(item As Outlook.mailItem) is yours better?
 
We could do a quick fix later (it could be quite difficult to get all the edge cases), but an inspection shouldn't be that hard.
@Phrancis Well, yours is implicitly public.
But otherwise, yours is better if you don't need to return anything.
Mat's would work better if you were going to return whether marking it as read was a success.
 
Will having all the Outlook application boilerplate Dims called each time put more strain on Outlook? (considering it could be called thousands of times per hour)
Although... I guess it would be called for each mail item anyways eh...
'First check items that meet some criteria:
If InStr(item.SenderName, "partnerlinksupport") > 0 _
    Or InStr(item.SenderName, "SQLAdmin") > 0 _
    And InStr(item.Recipients, "intdev-all") > 0 _
    And InStr(item.Subject, "error") > 0 _
    Or InStr(item.Subject, "exception") > 0 _
Then
    'Exceptions here:
    If Not InStr(item.Subject, "QueryDatabases - Supplies Check") > 0 _
    Then
        HandleErrorMailItem (item)
    End If
End If
Sure looks cleaner
 
OK, do you know the precedence of those And and Or operators?
 
7:38 PM
I'd think it's If (A Or B) And (C) And (D Or E) but haven't tested
 
Nope.
And has higher precedence.
If (A) Or (B) Or (C And D And E) Or (F)
 
WTF
 
I've never met a language with Or having higher precedence than And.
 
Except VBA?
 
I thought you might think that, it is a common problem. So, you need to add parenthesis to make the Or statements have higher precedence.
 
7:41 PM
Oh, didn't know you could do that; that's what I normally do in SQL
 
@Phrancis Sorry, I'm exhausted and not thinking straight.
 
If (InStr(item.SenderName, "partnerlinksupport") > 0 _
    Or InStr(item.SenderName, "SQLAdmin") > 0) _
And InStr(item.Recipients, "intdev-all") > 0 _
And (InStr(item.Subject, "error") > 0 _
    Or InStr(item.Subject, "exception") > 0) _
Then
Like that?
 
Yup, should work.
 
Sweet, thanks for letting me know :)
 
7:59 PM
@Phrancis also, your InStr will be case sensitive, unless you add an Option Compare Text statement at the top of your module, but it's safer to explicitly set the text comparison in the InStr function.
eg. If InStr(1, "Foo", "FOO", vbTextCompare) > 0 Then
 
Doesn't VBA have a String.Contains method?
 
you're looking at it
 
OK.
 
lol
4
Q: A more readable InStr: StringContains

Mat's MugConsider the following: If myString = "abc" Or myString = "def" [...] Or myString = "xyz" Then In C# when myString == "abc" the rest of the conditions aren't evaluated. But because of how VB works, the entire expression needs to be evaluated, even if a match is found with the first comparison....

 
Once upon a time, InStrRev, Split and Join didn't exist in VBA, but iirc, did exist in VB.
@Phrancis - Note the overload of InStr that accepts a vbCompare argument, seems to require the first parameter to be the start position.
 
8:10 PM
@ThunderFrame What is the first argument 1 for?
 
@Phrancis ^ "the first parameter to be the start position"
 
Oh, right (sorry)
 
9:12 PM
Does this look right?
If Not (inbox.Folders.item(i).Name = "_ErrorDump") Then
    inbox.Folders.Add ("_ErrorDump")
End If
Set destFolder = inbox.Folders("_ErrorDump")
Wish I had a test environment lol
 
Then write a method that implements your logic without the side-effects, that you can test :-)
 
Maybe just have it pop-up a notification or something like that?
 
hmm
looks right anyway
 
The other conditions appear to work fine
 
Ctrl+G then
?item.Recipients
 
9:27 PM
Run-time error 5, invalid call or argument...
 
does ?typename(item.recipients) output "String"?
it could be an array or something
 
Nope, it's of type Recipients... let me try something
 
I'm not all that familiar with the outlook object model..
 
Looks like I'm gonna need to foreach
And parse a Recipient.Address
3
A: Getting mailaddresses out of recipients of an mailItem

JimmyPenaI assume this is Outlook 2007+. Have you tried the Address Property? For Each Recipient In mai.Recipients MsgBox Recipient.Address Next Recipient This should print the email address of each recipient.

Suddenly got a lot uglier
For Each Recipient In item.Recipients
    If InStr(item.Recipient, "intdev-all") > 0 _
    Then
        'First check items that meet some sender or subject criteria:
        If (InStr(item.SenderName, "partnerlinksupport") > 0 _
            Or InStr(item.SenderName, "SQLAdmin") > 0) _
        And (InStr(item.Subject, "error") > 0 _
            Or InStr(item.Subject, "exception") > 0) _
        Then
            'Exceptions here:
            If Not InStr(item.Subject, "QueryDatabases - Supplies Check") > 0 _
Doesn't work
Looks like I might need a PropertyAccessor
 
9:53 PM
WOO it worked!
 
00:00 - 22:0022:00 - 23:00

« first day (628 days earlier)      last day (2552 days later) »