none
Create dynamic custom outlook form available by Reply. RRS feed

  • Question

  • Hello,

    My goal is to send email to another outlook recipient. This email has to be created in VBA as it has to contain checkboxes and textboxes. Their count varies so I can't use static outlook form.

    I can open my custom form in outlook in VBA and add controls, but these controls don't show up when the receiver clicks on Reply button. Controls only show up when receiver use Forward button.

    We're using MS exchange. Form is saved as "Send form definition with item".

    Is it possible to "enable" the dynamically added controls in Reply form? How?

    Thanks in advance

    Friday, April 13, 2018 2:01 PM

All replies

  • Hello indian513,

    >>I can open my custom form in outlook in VBA and add controls, but these controls don't show up when the receiver clicks on Reply button.

    Do you mean the custom checkboxes and textboxes are unable to see in the reply mail? Except the checkboxes and textboes, what about the body content? Will them be available? Could you share a screenshot to show us the contradistinction between Reply mail and Forward mail?

    For sharing file, you could share the file via Cloud Storage, such as One Drive, and then put link address here. Thanks for understanding.

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 16, 2018 10:43 AM
  • Hello Terry,

    In Reply mail I don't have controls which were added by VBA, I can only see controls added "manually" in form designer (body, subject, cc, manually added checkboxes etc.), see:

    https://drive.google.com/open?id=1EfnyVbXWAfo9eQDQT69bdH9OJICr2plv

    But when I use Forward mail, I can see all controls (added manually or by VBA).

    https://drive.google.com/open?id=1UB4YwaSInvsM81dm_bW26--caanF3hAK

    Thanks for your time

    Monday, April 16, 2018 11:24 AM
  • Hello indian513,

    From the screenshots, it seems that only the controls added by VBA disappears but the original control designed on the form could continue to show on the reply mail, right?

    Would you mind share us the VBA code how do you add these controls?

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, April 18, 2018 7:08 AM
  • Hello Terry,


    yes, you're right, only the controls added by VBA disappears but the original control designed on the form could continue to show on the reply mail.

    Here is the code used to create an email:

    Sub test1()
    Dim reply As Object
    Dim mycmd As Object
    
    On Error Resume Next
        Set reply = Application.CreateItemFromTemplate("c:\Users\gm1182\AppData\Roaming\Microsoft\Templates\rfs request test.oft")
    If Err.Number <> 0 Then
        Err.Clear
        Exit Sub
    End If
    
    Set mycmd = reply.GetInspector.ModifiedFormPages("Message").Controls.Add("Forms.TextBox.1", "tbTest")
    With mycmd
        .Top = 70
        .Left = 100
        .Value = "# change this text pls and reply ###"
    End With
    
    reply.To = "example@xxx.com"
    reply.subject = "rfs request test"
    reply.body = "body2"
    
    reply.Display
    
    End Sub
    



    Wednesday, April 18, 2018 7:28 AM
  • Hello indian513,

    >>Form is saved as "Send form definition with item".

    What do you mean this? How do you set it ? In my test, not only the added control but also the original controls disappears while replying the mail. While forwarding the mail, the added controls also disappears but original controls keep remain. 

    Did I missed anything? Is there any other operation should I do to reproduce your issue?

    Best Regards,

    Terry 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, April 18, 2018 9:33 AM
  • Hello Terry,

    when you send the form without "Send form definition with item" then the recipient doesn't receive the form as he doesn't have the form definition. Therefore the "Send form definition with item" has to be checked, see attached screenshot https://drive.google.com/open?id=1GcHA8PEM8Et32yvtZt4G9Y_WKPIywfAX

    That's how I understand it.

    If you know another way to send a form (with checkboxes etc. created in VBA) to user and get his response by simple Reply click, I'm open for a discussion.

    Thanks

    Wednesday, April 18, 2018 11:19 AM
  • Hello indian513,

    As far as I know, while replying the custom form item, we could use specific form to reply the item. However, we could only specific a saved form. Which means your custom on the item will not be applied since your controls is added on the general item instead of adding on the specific form.

    I would suggest you try to custom a VBS reply event of the custom form. In the event, you could try to add controls while user replying this form. 

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, April 19, 2018 9:22 AM
  • Hello,

    No, it is not possible.

    As a workaround you may consider creating a COM add-in with an Outlook form region where you can display your dynamic content. Be aware, the add-in should be installed for both sides - a recipient and sender. See Creating Outlook Form Regions for more information.


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Monday, April 23, 2018 1:09 PM