PDA

View Full Version : Solved: Flagging Posts



Shellgrip
06-01-2005, 01:49 AM
I'm designing a custom form based on IPM.Post to be published in a public folder. The form has a number of checkboxes that indicate progression of the job and ideally what I'd like to do is have a flag set on the post according to the checkboxes set.

For example, new posting - Red Flag, first box checked, Yellow Flag, next box checked, Green Flag (and so on).

I've located a method to do this in Outlook VBA but I'd much rather have it embedded in the form itself as VBS. However, I can't locate the appropriate property. Can anyone offer any advice?

J

MOS MASTER
06-05-2005, 06:50 AM
Hi and Welcome to VBAX! :hi:

I've missed this post....

Well don't know exactly what you mean but I'm sure there is a work arround.

Would you be so kind to post your VBA code of the functionallity you're looking for so I can see what you're trying to do?

And could you attach your *oft file (zipped) so I can test allong with you to get the job done?

Later..:whistle:

Shellgrip
06-06-2005, 02:53 AM
Thanks for the reply, I was beginning to think I was asking the impossible!

Outlook messages have a property FlagStatus that can be used to manipulate the various flags (using Outlook values such as olNoFlag, olFlagComplete, etc. or numeric values). However, I can't locate any property equivalent in VBS that I can use with my custom form.

The form uses flags (i.e., I can flag a post in the 'manual' way from within Outlook) so surely there must be some way of addressing these?

Any help appreciated.

Jon

MOS MASTER
06-06-2005, 09:27 AM
Hi Jon, :yes

Like I said the answer couldn't be far away.

But I have limited time and I always like to test stuff. That's why I asked for the VBA code you where using that needs to be converted to VBScript for the *oft file.

If you post both of them I'll test to create a sollution for you. :whistle:

Shellgrip
06-07-2005, 04:55 AM
Thanks again. I've attached the .oft of the post I'm developing. The check boxes on the second page are the ones I want to trigger the flag status.

This:


Option Explicit
Sub MoveItems()
Dim Messages As Selection
Dim Msg As MailItem
Dim NamSpace As NameSpace
Dim Proceed As VbMsgBoxResult

Set NamSpace = Application.GetNamespace("MAPI")
Set Messages = ActiveExplorer.Selection

If Messages.Count = 0 Then
Exit Sub
End If
For Each Msg In Messages
If Msg.FlagStatus = 2 Then
Proceed = MsgBox("Are you sure you want to do this? ", vbYesNo + vbQuestion, "Confirm Procedure")
If Proceed = vbYes Then
Msg.FlagStatus = olFlagComplete
Msg.FlagIcon = olGreenFlagIcon
End If
End If
Next

End Sub


in the Outlook session will take selected messages with a flag set and change it to Green and completed. What I need is for this sort of change to be triggered by ticking the checkboxes on page two BUT in VBS, not as a session VBA sub.

I hope this makes sense. Thanks for looking.

Jon

MOS MASTER
06-07-2005, 10:26 AM
Hi Jon, :yes

I'll start on it A.S.A.P.

Later..:whistle:

MOS MASTER
06-07-2005, 11:37 AM
Thanks again. I've attached the .oft of the post I'm developing. The check boxes on the second page are the ones I want to trigger the flag status.

in the Outlook session will take selected messages with a flag set and change it to Green and completed. What I need is for this sort of change to be triggered by ticking the checkboxes on page two BUT in VBS, not as a session VBA sub.

I hope this makes sense. Thanks for looking.

Jon
Hi Jon, :yes

Actually now I had time to look at it..no it doesn't! :doh:

You've build a custom form of the "PostItem" Class.
But you're asking to put a Flag and Flagstatus on this PostItem? That's kinda strange to me because a PostItem doesn't have such a property. (Meaning it just isn't possible)

The code you've posted will not work on PostItems but does work on MailItems (Different class).

So I haven't got a clue if I'm reading you correct.

If you mean something else please clarify? (Could it have something to do with the mailItem your sending when a userproperty changes?)

Later...:whistle:

Shellgrip
06-08-2005, 07:24 AM
Thanks Joost. That is exactly the problem! FlagStatus doesn't appear to work on Post items (as you say, presumably because the property doesn't exist). However, postitems do have the ability to be flagged - they have the flag icon and can be flagged by right-clicking in exactly the same way as a message.

So, if the flagstatus property doesn't exist for Post items, how does Outlook handle their flagging? :doh:

Jon

MOS MASTER
06-08-2005, 09:31 AM
Hi Jon, :yes

Yes I understand this could be frustrating! (And I'm sorry I didn't quite get you right the first time...)

I thought you wanted to do something with the generated email of the email you could send from the post. Hence your VBA code that runs on mails.

When I reread your post I thought you where talking about doing this to the PostItem. So that's why I had to confirm...and it was a good thing I did.

Ok..the property for flagging only works on the MailItem and MeetingItem. I couldn't explain why but those are the items for which Microsoft provided this property.

I must clear something up here.
You say:

So, if the flagstatus property doesn't exist for Post items, how does Outlook handle their flagging? :doh:

This makes me believe you think that everything you can do by the user interface can also be done by VBA?

Well...I wish it was...but it just isn't! Lot's of things you can't do by the interface can be done by code and some of the things the interface can do you can't do by code! (and why is for the programmers of Microsoft)

I've spend some time looking for you last night if there are workarrounds and of course I also noticed you could do the action manually...but for now I've not found any.

Later...:whistle:

Shellgrip
06-09-2005, 01:27 AM
Thanks for your work on this Joost. Yep, I appreciate that not everything can be done by code (and that some things can only be done by code!) it just seemed odd that flagging is essentially the same process for messages and posts (at least visually) so why provide properties for one class and not another? Who knows what makes the minds in Microsoft tick :)

It's annoying but not crucial to the development - it was more a 'nice to have' than essential to the project. I'll find another method to show the various states of the progress.

Thanks again for your time and work on this - it's very useful to have someone to talk to!

Jon

MOS MASTER
06-09-2005, 09:27 AM
Who knows what makes the minds in Microsoft tick :)

Thanks again for your time and work on this - it's very useful to have someone to talk to!

Well the tick is ussualy off at MS...so who gets them synced up....:dunno :rofl:

Each Office App has its own developmentteam and they just don't work that well togher. Just by looking at handeling the same things accross apps. (There can be big differences between the same actions)

You're most welcome and I hope I could have provided you with a sollution. :yes

Till we meet again.....