Results 1 to 8 of 8
  1. #1
    New Lounger
    Join Date
    Jul 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I created a fillable form in Word 2007 that includes a Submit command button that should attach the completed form as an email back to me. In Word 2003 I was able to use routing slips, but I understand that functionality was removed in Word 2007. Can you suggest an alternate?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Welcome to the Lounge!

    The Send To | Routing Recipient command has been removed from the Word 2007 interface, but it's still available in the VBA object model - see Route Method [Word 2007 Developer Reference].

  3. #3
    New Lounger
    Join Date
    Jul 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here is the script that I am using. What am I doing wrong???

    Private Sub CommandButton1_Click()

    ActiveDocument.HasRoutingSlip = True

    With ActiveDocument.RoutingSlip
    .Subject = "Feedback"
    .AddRecipient "me@employer.com"
    .Delivery = wdAllAtOnce
    End With

    If ActiveDocument.HasRoutingSlip = True Then ActiveDocument.Route

    End Sub

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    The line

    .AddRecipient "me@employer.com"

    will add me@employer.com as the routing recipient (who will send the message back to you, the original sender). Is that what you intended? I have a vague suspicion that you expect me@employer.com to be the return address.

  5. #5
    New Lounger
    Join Date
    Jul 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am attaching a blank copy of the file to an outgoing email. The recipient opens the file, fills out the form, clicks the submit button, and the line

    .AddRecipient "me@employer.com"

    should cause their completed form to be attached to an email back to me. It works perfectly in 2003 but does not work (and usually crashes) in 2007.

    I tried a completely different approach that works fabulously in 2007 except that the user has to save the file before clicking the submit button or all I get back is a blank form. Saving first is not an option in this case, but maybe there is a fix for that approach instead? Here is the script, which I found in another forum:

    Dim o1App As Object
    Dim o1Msg As Object

    Set o1App = CreateObject("Outlook.Application")
    Set o1Msg = o1App.CreateItem(0)
    With o1Msg
    .To = "email add"
    .Subject = "subject"
    .Body = "body"
    .Attachments.Add Me.Path + "\" + Me.Name

    .Send
    End With
    Set o1Msg = Nothing
    Set o1App = Nothing

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I had misunderstood your intention. I have no idea why the Routing code fails in Word 2007, I don't use that version myself.

    Couldn't you save the document in your Outlook automation code?

    Alternatively, you can use code like this:

    Code:
    With ActiveDocument.MailEnvelope.Item
      .Recipients.Add "me@employer.com"
      .Subject = "Testing 1 2 3"
    End With
    ActiveWindow.EnvelopeVisible = True
    The user will still have to click the "Send a copy" button.

  7. #7
    New Lounger
    Join Date
    Jul 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    My understanding is that routing slips were entirely removed from 2007 in favor of Sharepoint. I tried inserting your suggested code and am probably just sticking it in the wrong spot, rank beginner that I am. The debugger pops right up and suggests that I do something about the ActiveWindow.EnvelopeVisible=True line. Arrgh!

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I can't test in Word 2007 myself; hopefully somebody else will be kind enough to try it out and to assist you further.

Posting Permissions

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