accessing items of a field-collection via vbscript 
Author Message
 accessing items of a field-collection via vbscript

I neither have a working solution for you nor do I know the offset in your
field ID's. But you should take a look at http://www.*-*-*.com/
for some pointers.

PS: Please cut crossposting. This is considered inappropriate.
--
Siegfried Weber

Microsoft Most Valuable Professional (MVP) - Exchange Server
Co-author of "Professional CDO Programming", Wrox Press 1999

CDOLive - The Premier Resource for Microsoft Collaboration Data Objects
http://www.*-*-*.com/

Please reply to the newsgroups so that others can benefit from the
discussion.
Questions by e-mail are discarded without further notice - filter active.


Quote:
> dear all,

> at the moment i try to finish my studies by writing my final tests
> my job is to generate a task at a public folder on an exchange-server
> environment.
> i've to manipulate the following listed fields at the task-item by using a
> scripting host job:
>     BillingInformation
>     Milage
>     StartDate
>     DueDate
>     DateCompleted
>     PercentComplete
>     Companies
>     Complete
>     TotalWork
>     ActualWork
>     Owner
>     ReminderSet
>     ReminderTime
>     IsRecurring
>{*filter*}i tryied to access these fields by using the named property for
> example:

> with myTaskItem
>     .Milage=str_TEST_MILAGE
>     .Type="IPM.Task." & OL_Obj_FormName
>     .Text = str_TEST_TEXT
>     .Subject = str_SUBJECT_TEXT
>     .importance=INT_IMPORTANCE
> end with

> this was working great.
> but this method doesn't work with fields like:
>     BillingInformation
>     Milage
>     StartDate
>     DueDate
>     DateCompleted
>     PercentComplete
>     etc.
> so i tryied to access these fields by using the .Fields(FieldID) property.

> i wrote the following code - segment as a macro into an outlook task item,
> in order
> to find out these ID's.

> Dim objSession
> Dim objItem
> Dim objField
>     If Item.EntryID = "" Then Item.Save
>     Set lb =
> Item.GetInspector.ModifiedFormPages("P.2").Controls("ListFields")
>     lb.Clear
>     Set objSession = CreateObject("MAPI.Session")
>     objSession.Logon "", "", False, False
>     Set objItem = objSession.GetMessage(Item.EntryID, Item.Parent.StoreID)
>     On Error Resume Next

>     For Each objField in objItem.Fields
>         FieldID = Right("00000000" & Hex(objField.ID), 8) & " = "
>         FieldValue = objField.Value

>         If IsArray(FieldValue) Then
>             For i = LBound(FieldValue) To UBound(FieldValue)
>                 lb.AddItem FieldID & "(" & i & ") " & FieldValue(i)
>             Next
>         Else
>             lb.AddItem FieldID & FieldValue
>         End If
>     Next
> .
> .

> the code dumps the FieldID's into the listbox. this was my startup-point
to
> change my
> windows scripting host file to access the fields by using the FieldID.
> on my own exchange-server environment it'll work propper, but if i try to
> export it to other
> exchange environments it doesn't.
> so i've checked the Fieldid's (by using the listed code) on the other
> exchange environment and
> found out, the these id's have changed. i actually think that there is an
> offset, created by the
> exchange server, who is added to the BaseID of the named fields.

>  i found some stuff on the Microsoft TechNet under PSS ID : Q195656.
> but the solution written in the article also doesn't work

> SO Who can:
>      -tell me something about this bit-operation with the FielID and
BaseID
>      -show me an other way to resolve the problem
>      -or SIMPLY?!?!? give me a propper working solution for this problem

>  best regards

>      AXEL...



Sat, 19 Apr 2003 13:36:44 GMT  
 accessing items of a field-collection via vbscript
dear all,

at the moment i try to finish my studies by writing my final tests
my job is to generate a task at a public folder on an exchange-server
environment.
i've to manipulate the following listed fields at the task-item by using a
scripting host job:
    BillingInformation
    Milage
    StartDate
    DueDate
    DateCompleted
    PercentComplete
    Companies
    Complete
    TotalWork
    ActualWork
    Owner
    ReminderSet
    ReminderTime
    IsRecurring
{*filter*}i tryied to access these fields by using the named property for
example:

with myTaskItem
    .Milage=str_TEST_MILAGE
    .Type="IPM.Task." & OL_Obj_FormName
    .Text = str_TEST_TEXT
    .Subject = str_SUBJECT_TEXT
    .importance=INT_IMPORTANCE
end with

this was working great.
but this method doesn't work with fields like:
    BillingInformation
    Milage
    StartDate
    DueDate
    DateCompleted
    PercentComplete
    etc.
so i tryied to access these fields by using the .Fields(FieldID) property.

i wrote the following code - segment as a macro into an outlook task item,
in order
to find out these ID's.

Dim objSession
Dim objItem
Dim objField
    If Item.EntryID = "" Then Item.Save
    Set lb =
Item.GetInspector.ModifiedFormPages("P.2").Controls("ListFields")
    lb.Clear
    Set objSession = CreateObject("MAPI.Session")
    objSession.Logon "", "", False, False
    Set objItem = objSession.GetMessage(Item.EntryID, Item.Parent.StoreID)
    On Error Resume Next

    For Each objField in objItem.Fields
        FieldID = Right("00000000" & Hex(objField.ID), 8) & " = "
        FieldValue = objField.Value

        If IsArray(FieldValue) Then
            For i = LBound(FieldValue) To UBound(FieldValue)
                lb.AddItem FieldID & "(" & i & ") " & FieldValue(i)
            Next
        Else
            lb.AddItem FieldID & FieldValue
        End If
    Next
.
.

the code dumps the FieldID's into the listbox. this was my startup-point to
change my
windows scripting host file to access the fields by using the FieldID.
on my own exchange-server environment it'll work propper, but if i try to
export it to other
exchange environments it doesn't.
so i've checked the Fieldid's (by using the listed code) on the other
exchange environment and
found out, the these id's have changed. i actually think that there is an
offset, created by the
exchange server, who is added to the BaseID of the named fields.

 i found some stuff on the Microsoft TechNet under PSS ID : Q195656.
but the solution written in the article also doesn't work

SO Who can:
     -tell me something about this bit-operation with the FielID and BaseID
     -show me an other way to resolve the problem
     -or SIMPLY?!?!? give me a propper working solution for this problem

 best regards

     AXEL...



Sat, 19 Apr 2003 13:36:42 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. accessing items of a field-collection via vbscript

2. accessing items of a field-collection via vbscript

3. Use of document.all.item or .tags returns signle item not a collection of one item

4. I need to be able to add new fields to a MS Access table via VbScript

5. I need to be able to add new fields to a MS Access table via VbScript

6. VB Collections - Accessing the collection, not the item.

7. accessing items in a files collection

8. Outlook 97 Vbscript to move each item in a collection to new folder

9. Variable field Names/Item not in Collection

10. Item Not Found in Collection (Null Fields)

11. Accessing field containing GUID via ODBC and Access97

12. Newbie - accessing Text DataType field via VBS file.

 

 
Powered by phpBB® Forum Software