Results 1 to 8 of 8
  1. #1
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Routing slips (Word 2000 and 97)

    This is a cross post from <post#=188095>post 188095</post#> in the Word forum because I have had no respone there.

    I am creating a collection of forms that my client will distribute to their clients. We want it to be easy for the final users to send completed
    forms back to my client, so each form has an "email" button on it that uses ActiveDocument.SendMail to email the form back.
    As far as I can find out, the only way to specify the recipient of the email is to use a routing slip, so I have attached routing slips, but I now
    find that when I attach a routing slip, my email address is hardcoded in as the sender. When I put these docs on someone else's
    computer the routing slips don't work because the computer doesn't know who john hutchison is.
    So my question is : is there a way a specifying the recipient of SendMail that will work when the document is run from some other as yet unspecified computer?

    Also I can't assume that the final users will use Outlook as their email program, so I can't try to do it via Outlook objects.
    Regards
    John



  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Routing slips (Word 2000 and 97)

    Therefore, you need a SMTP method or extended MAPI. I don't think any VB or VBA environment can
    use Ext. MAPI directly, but a COM object called Redeption http://www.dimastr.com will expose
    those objects for you.

    I use a Web server with CDONTS installed to send email from all Office-based apps. Do a google
    serch for CDONTS and search this forum for same.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Routing slips (Word 2000 and 97)

    I'm probably over my head, but can't you use a fully qualified e-mail address like this, and then it will work with any MAPI server?

    ThisDocument.SendMail "johnhutchison@mycompany.com.uk", _
    ThisDocument.Name & " completed by " & Application.Username

    which is a very slight variation on a distributed Excel template users e-mail back to me upon completion. In my initial testing I had non-Outlook compuserve users test it with success.
    -John ... I float in liquid gardens
    UTC -7ąDS

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Routing slips (Word 2000 and 97)

    Thanks for that. I will look into it.
    Regards
    John



  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Routing slips (Word 2000 and 97)

    I will try this out, but in <post#=36357>post 36357</post#> I found that for some reason Excel allows you to add a recipient to sendmail, but Word doesn't. That post said that you need the routing slip.
    Regards
    John



  6. #6
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Routing slips (Word 2000 and 97)

    I was wrong; the Excel method doesn't work in Word, and the routing slip method doesn't accept fully resolved recipient e-mail addresses. I'll be watching to see how this works.
    -John ... I float in liquid gardens
    UTC -7ąDS

  7. #7
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    378
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Routing slips (Word 2000 and 97)

    Hi John

    I stumbled on this thread a little late in the piece, so my contribution may be too late.

    I've discovered an alternative method, which the following snippet illustrates:
    <pre> On Error Resume Next
    ActiveWorkbook.HasRoutingSlip = False
    On Error GoTo 0
    ActiveWorkbook.HasRoutingSlip = True
    With ActiveWorkbook.RoutingSlip
    .Subject = MySubject
    .Recipients = MyEmailAddress
    .Message = MyMessage
    .Delivery = xlAllAtOnce
    End With
    On Error GoTo ErrorProcessing
    ActiveWorkbook.Route
    On Error GoTo 0
    ActiveWorkbook.Close SaveChanges:=False
    </pre>


    There are aspects to this I don't understand (I got the idea from someone else's macros, who isn't available for questions), such as why you have to set HasRoutingSlip to False before setting it to True. Nevertheless, it works (using GroupWise email in an NT environment), although I don't know how to deal with the following:
    1. <LI>The following text is appended to the message, and I don't know how to stop it appearing:
      <hr>The attached document has a routing slip. When you are done reviewing this document, choose Next Routing Recipient from the Microsoft Excel Send To menu on the File menu to return the document to its sender.<hr>
      <LI>When the recipient opens the attachment, then closes it, they get the following message:
      <hr><workbookname> has a routing slip. Route now to <sendersemailaddress><hr>
      I don't know how to stop this, either.
    Note: This also works in Word, but you have to replace ".Recipients" with ".AddRecipient".

    Hope that helps
    Dale

  8. #8
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Routing slips (Word 2000 and 97)

    Thanks for this. I will try it out and see what happens.

    I just removed the Routing Slips a while ago.

    Does this method avoid the problem of my email address being hardcoded in as the sender?

    I could get them to work, but the moment I gave the documents to someone else, they tried to use my email address as the sender, rather than the address of the person using them.
    Regards
    John



Posting Permissions

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