Hi,
I am able to highlight a comment cell in Excel, have Excel grab adjacent cell values, create and populate post in Outlook. dARCHIVED and dHIGHLIGHT are YesNo fields with OptionButton controls. From Excel, I can create the items and set their values.
I cannot setup dTASKGROUP. dTASKGROUP is a Keywords field controlled by a Dropdown ComboBox. I've tried .add, .find, setting, and the best I can do is create the item but not set the value. I've also tried specifying other stringy UserPropertyTypes with no luck.
Sub PostInOutlook()
'**Dim and Build Strings Removed for Forum Post**
Dim OutlookNS As Outlook.Namespace
Dim OutlookFolder As Outlook.Folder
Dim OutlookPost As Outlook.PostItem
Set OutlookNS = Outlook.GetNamespace("MAPI")
Set OutlookFolder = OutlookNS.Folders("someone@microsoft.com").Folders("Inbox").Folders("TASKMEISTER")
Set OutlookPost = OutlookFolder.Items.Add(olPostItem)
With OutlookPost
.Subject = z
.Body = w
.UserProperties.Add("dARCHIVED", olYesNo).Value = 0
.UserProperties.Add("dHIGHLIGHT", olYesNo).Value = 0
.UserProperties.Add("dTASKGROUP", olText) = j
.MessageClass = "IPM.Post.TaskPost100"
.Save
End With
End Sub
What am I doing wrong?
Thank you
I am able to highlight a comment cell in Excel, have Excel grab adjacent cell values, create and populate post in Outlook. dARCHIVED and dHIGHLIGHT are YesNo fields with OptionButton controls. From Excel, I can create the items and set their values.
I cannot setup dTASKGROUP. dTASKGROUP is a Keywords field controlled by a Dropdown ComboBox. I've tried .add, .find, setting, and the best I can do is create the item but not set the value. I've also tried specifying other stringy UserPropertyTypes with no luck.
Sub PostInOutlook()
'**Dim and Build Strings Removed for Forum Post**
Dim OutlookNS As Outlook.Namespace
Dim OutlookFolder As Outlook.Folder
Dim OutlookPost As Outlook.PostItem
Set OutlookNS = Outlook.GetNamespace("MAPI")
Set OutlookFolder = OutlookNS.Folders("someone@microsoft.com").Folders("Inbox").Folders("TASKMEISTER")
Set OutlookPost = OutlookFolder.Items.Add(olPostItem)
With OutlookPost
.Subject = z
.Body = w
.UserProperties.Add("dARCHIVED", olYesNo).Value = 0
.UserProperties.Add("dHIGHLIGHT", olYesNo).Value = 0
.UserProperties.Add("dTASKGROUP", olText) = j
.MessageClass = "IPM.Post.TaskPost100"
.Save
End With
End Sub
What am I doing wrong?
Thank you