Consulting

Results 1 to 11 of 11

Thread: Solved: Flagging Posts

  1. #1

    Question Solved: Flagging Posts

    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

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi and Welcome to VBAX!

    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..
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  3. #3

    Flagging messages

    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

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi Jon,

    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.
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  5. #5

    Flagging Posts

    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:

    [VBA]
    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
    [/VBA]

    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

  6. #6
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi Jon,

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

    Later..
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  7. #7
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Quote Originally Posted by Shellgrip
    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,

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

    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...
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  8. #8

    Flagging Posts

    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?

    Jon

  9. #9
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi Jon,

    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?
    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...
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  10. #10

    Flagging posts

    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

  11. #11
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Quote Originally Posted by Shellgrip
    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....

    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.

    Till we meet again.....
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •