Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    122
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hi all,

    I've created a straightforward Word template (working with Word 2003/VB 6.5) where the active document has an email header (via File\Send to... Mail Recipient), and was wondering if anyone could tell me if it's possible (and if so, how) to populate the subject field using some of the userform text boxes?

    Many thanks,

    Violet

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by violet View Post
    I've created a straightforward Word template (working with Word 2003/VB 6.5) where the active document has an email header (via File\Send to... Mail Recipient), and was wondering if anyone could tell me if it's possible (and if so, how) to populate the subject field using some of the userform text boxes?
    Most likely. Of course, there may be a security prompt for the user to respond to.

    This sample code writes some text to the ActiveDocument's MailEnvelope. You can uncomment the Stop command to click into the object and take a closer look at its properties. Search the web for documentation; I didn't find much, but hopefully you can find anything else you need.

    Code:
    Sub DemoMailEnvelope()
    Dim menv As Office.MsoEnvelope
    Set menv = ActiveDocument.MailEnvelope
    With menv
        .Introduction = "I believe you will find this document facinating."
        'Stop    ' Call up View > Locals to view object properties
        With .Item
            .Recipients.Add "info@shhhhh.windowssecrets.com"
            .Subject = "My Brilliant Work!"
        End With
    End With
    Set menv = Nothing
    If Not ActiveWindow.EnvelopeVisible Then ActiveWindow.EnvelopeVisible = True
    End Sub

  3. #3
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    122
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks for that, Jefferson. That gets me half way to where I want to be so I'll continue to tinker...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •