none
Migrated vbscript from Outlook 2003 to Outlook 2013 RRS feed

  • Question

  • I found some script not working after migrated to Outlook 2013.

    Example 1) DateDiff("d", INPUT_DATE, Now())

    Example 2) Message.UserProperties.add("customField", olText)

    Please suggest how to use the function in Outlook 2013 via vbs, thanks.

    Wednesday, April 13, 2016 6:55 AM

Answers

  • Hi dson,

    >> The Microsoft VBScript runtime error prompt: Obejct required: 'UserProperties.Add(...)'

    Could you share us a simple code and detail steps to reproduce your issue?

    Here is a simple code to add UserProperties.

    Sub Btn_Click()
      Set oolApp = CreateObject("Outlook.Application")
      Set email = oolApp.CreateItem(olMailItem)
      set up=email.userproperties.add("test",1)
      email.Display
    end sub

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thanks, It's work, but I found the PR_MESSAGE_CLASS_W is changed to IPM.Note. How to keep the value? This is Outlook form.
    • Marked as answer by _dson Monday, April 18, 2016 6:10 AM
    Friday, April 15, 2016 3:27 AM

All replies

  • Hi dson,

    >>DateDiff("d", INPUT_DATE, Now())

    How did you use this function? What is the value for INPUT_DATE? Could you share us detail steps with this code to reproduce your issue? I made a test with the code below in Outlook 2013, it worked correctly.

    Sub CBbtn_Click()
    msgbox DateDiff("d", "2016-4-10", Now())
    End Sub

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, April 14, 2016 2:03 AM
  • Hi dson,

    >>DateDiff("d", INPUT_DATE, Now())

    How did you use this function? What is the value for INPUT_DATE? Could you share us detail steps with this code to reproduce your issue? I made a test with the code below in Outlook 2013, it worked correctly.

    Sub CBbtn_Click()
    msgbox DateDiff("d", "2016-4-10", Now())
    End Sub

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thanks Edward,

    I fixed the DateDiff problem, but still no solution in Message.UserProperties.add("customField", olText)


    Thursday, April 14, 2016 3:17 AM
  • Hello,

    Could you please describe the issue with a user property in depth? What exactly is not working?

    > Message.UserProperties.add("customField", olText)

    Did you try to save the item after adding a user property?


    [custom.development]

    Thursday, April 14, 2016 3:41 AM
  • Hello,

    Could you please describe the issue with a user property in depth? What exactly is not working?

    > Message.UserProperties.add("customField", olText)

    Did you try to save the item after adding a user property?


    [custom.development]

    The Microsoft VBScript runtime error prompt: Obejct required: 'UserProperties.Add(...)'

    Yes, I have save the item after adding, but the script is error when adding the user properties.

    It works on Outlook 2003, but not works on Outlook 2013.

    Thursday, April 14, 2016 3:45 AM
  • Hi dson,

    >> The Microsoft VBScript runtime error prompt: Obejct required: 'UserProperties.Add(...)'

    Could you share us a simple code and detail steps to reproduce your issue?

    Here is a simple code to add UserProperties.

    Sub Btn_Click()
      Set oolApp = CreateObject("Outlook.Application")
      Set email = oolApp.CreateItem(olMailItem)
      set up=email.userproperties.add("test",1)
      email.Display
    end sub

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, April 15, 2016 1:31 AM
  • Hi dson,

    >> The Microsoft VBScript runtime error prompt: Obejct required: 'UserProperties.Add(...)'

    Could you share us a simple code and detail steps to reproduce your issue?

    Here is a simple code to add UserProperties.

    Sub Btn_Click()
      Set oolApp = CreateObject("Outlook.Application")
      Set email = oolApp.CreateItem(olMailItem)
      set up=email.userproperties.add("test",1)
      email.Display
    end sub

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thanks, It's work, but I found the PR_MESSAGE_CLASS_W is changed to IPM.Note. How to keep the value? This is Outlook form.
    • Marked as answer by _dson Monday, April 18, 2016 6:10 AM
    Friday, April 15, 2016 3:27 AM
  • Any one can help?
    Monday, April 18, 2016 2:15 AM
  • Hi dson,

    >> It's work, but I found the PR_MESSAGE_CLASS_W is changed to IPM.Note. How to keep the value?

    If your original issue about Message.UserProperties.add has been resolved, I would suggest you mark the helpful reply as answer to close this thread.

    For this new issue about PR_MESSAGE_CLASS_W is changed to IPM.Note, I would suggest you post a new thread for this, and share us more information about this issue like what are you doing, and when it changed.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, April 18, 2016 5:12 AM