Confused about custom actions - I am a newbie.

  • Thread starter Thread starter Alan Campbell
  • Start date Start date
A

Alan Campbell

Hi,

I found code below in this group to create an action based on voting
buttons and modified to fit my needs. However, I have read in several
threads that custom actions are complicated and not generated in vb.
What does the function below do?

My intention was to have the body of the email remain in the response
when the recipient voted. Any help or explanation would be greatly
appreciated. Also, if this code does work as written, where would I
place it (e.g. module)? Thanks in advance.

Alan

Function Item_CustomAction(ByVal Action, ByVal NewItem)
If Action.Name = "V_Approved" Or Action.Name = "V_Rejected" Then
NewItem.Body = Item.Body
End If
End Function
 
The function below is an event handler for the VBScript code behind an
Outlook form. (In other words, it has nothing whatsoever to do with VBA.) If
the user clicks the V_Approved or V_Reject custom action button (like a
voting button), the code copies the body of the current item into the item
that the custom action creates.

You put script into a custom form in design mode by clicking the Edit Code
button.
 
Sue,

Thanks for the reply. As you can see, I am new to this and do most of my
work in Excel. The email being generated is based on the code below
(not that it matters for this problem). It generates an email with a
range as the body of the message. I have also activated the voting
action.

I need the body of the email to stay in the response regardless of the
supvisors response to the credit voucher. It is a small group and I
could set scripts code, etc. to run on their machines when the voting
option in my prior message is set.

Is there a way I can keep the body in the original body in the message
when they respond?

Once again, Thanks for your help.



Sub Mail_Selection_Outlook_Body()
 
The custom action code that you had in your earlier post should do the
trick, although I don't remember whether it was using Body or HTMLBody.
HTMLBody, of course, is what you want. You can add a custom action
programmatically with the OutMail.If you want code to run from an action,
the message would need to be created with a custom form that already has the
action and code built in. To create a new instance of a custom form
programmatically, use the Add method on the target folder's Items
collection. If it's a message form, you can use the Drafts folder as the
target.

The form would need to be published to each user's Personal Forms library,
with the "send form definition with item" box unchecked.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top