PC Review


Reply
Thread Tools Rate Thread

Dmitry? Can I use Redemption to return an array of custom forms in a folder?

 
 
Kristy
Guest
Posts: n/a
 
      27th Jan 2004
Hi

I have set up some custom forms that contain standard text (and
sometimes graphics) to be used in generic emails/replies/forwards, it
would be really great if I could use something like the below example,
to enable users to choose which standard form they want to use in the
quickest, easiest way possible.

The function below is great I have used it sucessfully on customers in
the past however going forward I do not want to have to use CDO if I
can help it (headaches with installation etc). Therefore, I would like
to know if it would be possible to create this array of custom forms
using extended MAPI and Redemption? I also don't want invoke any
security warnings (or have to install the admin pack for my addins to
be trusted) so Redemption is what I'd like to use. Unfortunately my
experience with redemption and to a certain extend the Outlook object
model is still relatively small so can anyone tell me if this is
actually possible and maybe give me some tips on how to do it please?
Any advice would be greatly appreciated:-)


'Code provided by MicroEye, CBItems example. This function enables me
to build a combobox which lists all the published forms in a folder.

'******************************************************************************

'Custom procedure: GetFormDescriptions(strEntryID, strStoreID)

'Purpose: Return a variant array containing custom forms in folder

'Argument: Outlook Entry ID, Store ID

'Usage:

'Set avarArray = GetFormDescriptions(objFolder.EntryID,
objFolder.StoreID)

'Returns: Variant Array

'******************************************************************************



Public Function GetFormDescriptions(strEntryID, strStoreID) As Variant

Dim objFolder As MAPI.Folder

Dim objMsgFilter As MAPI.MessageFilter

Dim colHiddenMsgs As MAPI.Messages

Dim objHiddenMsg As MAPI.Message

Dim avarArray As Variant

Dim intCount, intLoop As Integer

'MAPI Properties for FormDescription Hidden Messages

Const PR_HIDDEN_FORM = &H6803001E

Const PR_FORM_MESSAGECLASS = &H6800001E

Set objFolder = gobjCDO.GetFolder(strEntryID, strStoreID)

Set colHiddenMsgs = objFolder.HiddenMessages

'colHiddenMsgs.Sort CdoAscending, CdoPR_DISPLAY_NAME

If colHiddenMsgs.Count Then

'Set a filter on messages collection

Set objMsgFilter = colHiddenMsgs.Filter

objMsgFilter.Type = "IPM.Microsoft.FolderDesign.FormsDescription"

'Sort FormDescription collection on Display Name

colHiddenMsgs.Sort CdoAscending, CdoPR_DISPLAY_NAME

If colHiddenMsgs.Count Then

'Count number of forms in folder excluding hidden forms

For Each objHiddenMsg In colHiddenMsgs

If Not (objHiddenMsg.Fields(PR_HIDDEN_FORM)) Then

intCount = intCount + 1

End If

Next

If intCount Then

'Dimension variant array to hold forms

ReDim avarArray(intCount - 1, 1)

For Each objHiddenMsg In colHiddenMsgs

If Not (objHiddenMsg.Fields(PR_HIDDEN_FORM)) Then

avarArray(intLoop, 0) = _

objHiddenMsg.Fields(CdoPR_DISPLAY_NAME)

avarArray(intLoop, 1) = _

objHiddenMsg.Fields(PR_FORM_MESSAGECLASS)

intLoop = intLoop + 1

End If

Next

GetFormDescriptions = avarArray

Else

GetFormDescriptions = Empty

End If

Else

GetFormDescriptions = Empty

End If

End If

End Function


Cheers

Kris
 
Reply With Quote
 
 
 
 
Dmitry Streblechenko \(MVP\)
Guest
Posts: n/a
 
      27th Jan 2004
You can create an instance of Redemption.MAPIFolder object, set its Item
property to an Outlook.MAPIFolder object and use MAPIFolder.HiddenItems
collection

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


"Kristy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
>
> I have set up some custom forms that contain standard text (and
> sometimes graphics) to be used in generic emails/replies/forwards, it
> would be really great if I could use something like the below example,
> to enable users to choose which standard form they want to use in the
> quickest, easiest way possible.
>
> The function below is great I have used it sucessfully on customers in
> the past however going forward I do not want to have to use CDO if I
> can help it (headaches with installation etc). Therefore, I would like
> to know if it would be possible to create this array of custom forms
> using extended MAPI and Redemption? I also don't want invoke any
> security warnings (or have to install the admin pack for my addins to
> be trusted) so Redemption is what I'd like to use. Unfortunately my
> experience with redemption and to a certain extend the Outlook object
> model is still relatively small so can anyone tell me if this is
> actually possible and maybe give me some tips on how to do it please?
> Any advice would be greatly appreciated:-)
>
>
> 'Code provided by MicroEye, CBItems example. This function enables me
> to build a combobox which lists all the published forms in a folder.
>
>

'***************************************************************************
***
>
> 'Custom procedure: GetFormDescriptions(strEntryID, strStoreID)
>
> 'Purpose: Return a variant array containing custom forms in folder
>
> 'Argument: Outlook Entry ID, Store ID
>
> 'Usage:
>
> 'Set avarArray = GetFormDescriptions(objFolder.EntryID,
> objFolder.StoreID)
>
> 'Returns: Variant Array
>
>

'***************************************************************************
***
>
>
>
> Public Function GetFormDescriptions(strEntryID, strStoreID) As Variant
>
> Dim objFolder As MAPI.Folder
>
> Dim objMsgFilter As MAPI.MessageFilter
>
> Dim colHiddenMsgs As MAPI.Messages
>
> Dim objHiddenMsg As MAPI.Message
>
> Dim avarArray As Variant
>
> Dim intCount, intLoop As Integer
>
> 'MAPI Properties for FormDescription Hidden Messages
>
> Const PR_HIDDEN_FORM = &H6803001E
>
> Const PR_FORM_MESSAGECLASS = &H6800001E
>
> Set objFolder = gobjCDO.GetFolder(strEntryID, strStoreID)
>
> Set colHiddenMsgs = objFolder.HiddenMessages
>
> 'colHiddenMsgs.Sort CdoAscending, CdoPR_DISPLAY_NAME
>
> If colHiddenMsgs.Count Then
>
> 'Set a filter on messages collection
>
> Set objMsgFilter = colHiddenMsgs.Filter
>
> objMsgFilter.Type = "IPM.Microsoft.FolderDesign.FormsDescription"
>
> 'Sort FormDescription collection on Display Name
>
> colHiddenMsgs.Sort CdoAscending, CdoPR_DISPLAY_NAME
>
> If colHiddenMsgs.Count Then
>
> 'Count number of forms in folder excluding hidden forms
>
> For Each objHiddenMsg In colHiddenMsgs
>
> If Not (objHiddenMsg.Fields(PR_HIDDEN_FORM)) Then
>
> intCount = intCount + 1
>
> End If
>
> Next
>
> If intCount Then
>
> 'Dimension variant array to hold forms
>
> ReDim avarArray(intCount - 1, 1)
>
> For Each objHiddenMsg In colHiddenMsgs
>
> If Not (objHiddenMsg.Fields(PR_HIDDEN_FORM)) Then
>
> avarArray(intLoop, 0) = _
>
> objHiddenMsg.Fields(CdoPR_DISPLAY_NAME)
>
> avarArray(intLoop, 1) = _
>
> objHiddenMsg.Fields(PR_FORM_MESSAGECLASS)
>
> intLoop = intLoop + 1
>
> End If
>
> Next
>
> GetFormDescriptions = avarArray
>
> Else
>
> GetFormDescriptions = Empty
>
> End If
>
> Else
>
> GetFormDescriptions = Empty
>
> End If
>
> End If
>
> End Function
>
>
> Cheers
>
> Kris



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Function to return array Forgone Microsoft Access VBA Modules 2 9th Sep 2008 02:33 AM
Follow-up for Dmitry: Redemption and Reg-Free COM, how-to? =?Utf-8?B?TWlrZQ==?= Microsoft Outlook Program Addins 1 4th Oct 2007 07:33 PM
Custom Forms in a Public Folder Doreen Microsoft Outlook Contacts 1 13th Jan 2005 02:45 PM
copying a folder with custom forms =?Utf-8?B?bXZzamVzMg==?= Microsoft Outlook Form Programming 1 2nd Jan 2005 10:43 PM
Searching through folder w/ Custom Forms Koops Microsoft Outlook VBA Programming 4 25th Mar 2004 08:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:48 PM.