C
codemonkey_147
greetings.
current state of the union:
userdefined fields have been added to custom Outlook forms and are
being accessed and maintained by way of a dll
with those forms Project information (such as Project ID number,
Project Name, etc) can be associated with a particular Outlook item.
in most items the itemroject association is n:1 , and therefore each
individual piece of info has a userdefined field in the form and
published in the folder, except for the Contacts , where the
association is n:n .in ordert to accomodate that a different field was
created that stores the project information in a structured ,
delimited format and updates it according to user input.
in oder to take advantage of this information i created a VB form and
added an Outlook ViewCtl item to it. the idea was that the user can
pick a certain Project beforehand and use buttons on the form to
switch between folders which would only show the contents that applied
to the previously defined project. the criteria by which would be
decided what items would be shown was the ProjectID and the folder
which were to be applied to the ViewCtl were known (ie. always the
same folders).
4 of the 6 folders have the "ProjectID" field, the other 2 have the
"info" field that contains the delimited string (which can contain 1
or more instances of a ProjectID)
upon selection of a button the .Folder and .Restriction properties of
the ViewCtl should be changed (which should show the desired effects
inside the view control in the Form)
the problem i have run into is that the buttons/changes for the 4
folders that have the "ProjectID" field function properly, yet the 2
that have the "info" field throw an error as soon as the .Restriction
is being set.
i have double checked and the "info" property is defined both as a
field on the form and as a userdefined folder field. furthermore the
code used to change the fields is identical for all the Subroutines.
the code that i'm using to change the field properties:
' inside Private Sub ________Click(Index As Integer)
' temp is a String variable set to the path of the folder the OVC is
supposed to work with at the time
' strProjectIDNum is a String variable set to the Project ID number to
be used as a filter
frmProjDialog.ovcResults.Item(frmProjDialog.ovcResults.UBound).DeferUpdate
= True
frmProjDialog.ovcResults.Item(frmProjDialog.ovcResults.UBound).Folder
= temp
frmProjDialog.ovcResults.Item(frmProjDialog.ovcResults.UBound).DeferUpdate
= False
frmProjDialog.ovcResults.Item(frmProjDialog.ovcResults.UBound).Restriction
= _
"[ProjectID] = """ & strProjectIDNum & """"
? why am i not using a "With" / "End With" statement block? it broke
the code, last i tried. after i removed it some errors disappeared.
? why am i including the (frmProjDialog.ovcResults.UBound) ? because
apparently there is an array defined within the ViewCtl and the one
and only item in it is @ pos 6. to make sure i get it (in case that
value changes) i access it at UBound.
my questions.
- is there anything about the viewctl that i have missed
(initializationwise etc.)
- am i using (referencing & setting) the properties correctly
- any ideas on why the same code for the same type of thing (changing
the value of a user defined property) will work for one but not the
other
i could really use some help on this and would appreciate any ideas.
any further questions & clarifications i can provide, just ask.
-cm
current state of the union:
userdefined fields have been added to custom Outlook forms and are
being accessed and maintained by way of a dll
with those forms Project information (such as Project ID number,
Project Name, etc) can be associated with a particular Outlook item.
in most items the itemroject association is n:1 , and therefore each
individual piece of info has a userdefined field in the form and
published in the folder, except for the Contacts , where the
association is n:n .in ordert to accomodate that a different field was
created that stores the project information in a structured ,
delimited format and updates it according to user input.
in oder to take advantage of this information i created a VB form and
added an Outlook ViewCtl item to it. the idea was that the user can
pick a certain Project beforehand and use buttons on the form to
switch between folders which would only show the contents that applied
to the previously defined project. the criteria by which would be
decided what items would be shown was the ProjectID and the folder
which were to be applied to the ViewCtl were known (ie. always the
same folders).
4 of the 6 folders have the "ProjectID" field, the other 2 have the
"info" field that contains the delimited string (which can contain 1
or more instances of a ProjectID)
upon selection of a button the .Folder and .Restriction properties of
the ViewCtl should be changed (which should show the desired effects
inside the view control in the Form)
the problem i have run into is that the buttons/changes for the 4
folders that have the "ProjectID" field function properly, yet the 2
that have the "info" field throw an error as soon as the .Restriction
is being set.
i have double checked and the "info" property is defined both as a
field on the form and as a userdefined folder field. furthermore the
code used to change the fields is identical for all the Subroutines.
the code that i'm using to change the field properties:
' inside Private Sub ________Click(Index As Integer)
' temp is a String variable set to the path of the folder the OVC is
supposed to work with at the time
' strProjectIDNum is a String variable set to the Project ID number to
be used as a filter
frmProjDialog.ovcResults.Item(frmProjDialog.ovcResults.UBound).DeferUpdate
= True
frmProjDialog.ovcResults.Item(frmProjDialog.ovcResults.UBound).Folder
= temp
frmProjDialog.ovcResults.Item(frmProjDialog.ovcResults.UBound).DeferUpdate
= False
frmProjDialog.ovcResults.Item(frmProjDialog.ovcResults.UBound).Restriction
= _
"[ProjectID] = """ & strProjectIDNum & """"
? why am i not using a "With" / "End With" statement block? it broke
the code, last i tried. after i removed it some errors disappeared.
? why am i including the (frmProjDialog.ovcResults.UBound) ? because
apparently there is an array defined within the ViewCtl and the one
and only item in it is @ pos 6. to make sure i get it (in case that
value changes) i access it at UBound.
my questions.
- is there anything about the viewctl that i have missed
(initializationwise etc.)
- am i using (referencing & setting) the properties correctly
- any ideas on why the same code for the same type of thing (changing
the value of a user defined property) will work for one but not the
other
i could really use some help on this and would appreciate any ideas.
any further questions & clarifications i can provide, just ask.
-cm