• Customize Automatically Send Doc over Email

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Customize Automatically Send Doc over Email

    Author
    Topic
    #353703

    Hi Everyone–

    Word 97, Win 95, Outlook 98. I’m trying to set up a document so that when you’re done with it, you can click a button and an email with the document will automatically go to an Outlook (98) recipient. I’ve kind of fudged it with using routing, but it’s not a great solution. I saw SendMail in there, but there seems to be no way to specify a recipient (at least not in the documentation). [This is one of those things when I go–Why can’t it be just like Access???]

    The document I’m trying to send is a protected Word form, but I can’t just put the form into Outlook because there’s no way to protect it in there (so the user can tab through the form fields).

    I’m sure someone out there has done this before. Any ideas, or suggestions, no matter how crazy, are very welcome.

    Thanks!

    Cecilia 🙂

    Viewing 0 reply threads
    Author
    Replies
    • #601696

      Have you considered using a PDF form (File extension *.fdf)?

      • #601799

        EEEEEEECCCCCCKKKKKK!

        Actually, I found the answer elsewhere.

        • #601831

          Hi Cecilia:
          How about sharing the solution? It may be useful when others have this problem.

          Cheers,

          • #601891

            Phil,

            I do this all the time for our intranet. I use a control button located in a text frame for the e-mail button and a script from Chris Rae to e-mail.

            The code for the buttons:

            Private Sub link_to_index_Click()

            ActiveDocument.FollowHyperlink Address:= _
            “aide_memoire.htm”, NewWindow:=False _
            , AddHistory:=True

            End Sub

            Private Sub print_form_Click()

            With ActiveDocument

            .Shapes(1).Visible = msoFalse
            .PrintOut Background:=False
            .Shapes(1).Visible = msoTrue

            End With

            End Sub

            Private Sub send_form_Click()

            MailDoc3

            End Sub

            Button 1 returns the user to the document index, button 2 prints the form without showing the button bar and 3 e-mails the form using the script below:

            Sub MailDoc3()

            ActiveDocument.SaveAs FileName:=”bsg402.doc”

            ‘ Make instance
            Set myOutlook = CreateObject(“Outlook.Application”)
            ‘ Make mail item
            Set myMailItem = myOutlook.createitem(0)
            ‘ Set recipient (internal mail)

            myMailItem.Recipients.Add “Stroud, Phyl”
            myMailItem.Recipients.Add “Jones, Christine (SW)”

            myMailItem.Recipients.Add “Humanresources”
            myMailItem.Recipients.Add “SWSITESECURITY”

            ‘ Set subject
            myMailItem.Subject = “Starters & Leavers – Team Managers”
            ‘ Set body
            myMailItem.body = “The attached form BSG 402 contains personnel details for your attention.”
            ‘ Set open doc as attachement
            myMailItem.Attachments.Add ActiveDocument.FullName
            ‘ And send it!
            myMailItem.send
            ‘ Close instance
            Set myOutlook = Nothing

            End Sub

            The mail macro came from Chris Rae here

            http://chrisrae.com/vba/routines/sendmail.html%5B/url%5D

            and the non-printing button bar from the MVP web:

            http://www.mvps.org/word/FAQs/TblsFldsFms/…PrintButton.htm%5B/url%5D

            David

            • #601898

              Hi Solomod:
              I saw part of this in another thread you posted. I actually don’t use Outlook for mail, but thank you for the info.

          • #601992

            I had thought of doing that at the time, but was away from my files….

            It’s pretty much what Solomod has below:

            Public Sub MailDoc()
            On Error GoTo HandleError

            Dim myOutlook As Object
            Dim myMailItem As Object

            ActiveDocument.SaveAs ActiveDocument.Name
            Set myOutlook = CreateObject(“Outlook.Application”)
            Set myMailItem = myOutlook.createitem(0)

            myMailItem.Recipients.Add “recipient1”
            myMailItem.Recipients.Add “recipient2”

            myMailItem.Subject = “This is my subject”
            myMailItem.body = “This is my body”
            myMailItem.Attachments.Add ActiveDocument.FullName
            myMailItem.send

            Set myOutlook = Nothing

            Exit Sub
            HandleError:
            MsgBox “Report this error to ROMIG: ” & vbCrLf & vbCrLf _
            & Err.Number & ” ” & Err.Description, , “Message Send Error”

            End Sub

    Viewing 0 reply threads
    Reply To: Customize Automatically Send Doc over Email

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: