Results 1 to 5 of 5

Thread: How Do I Send Attachments from Word Without Outlook?

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2010
    Posts
    4

    How Do I Send Attachments from Word Without Outlook?

    I desperately need help. What code do I use to send attachments from Word '03 without Outlook? I think its done with CDO. What code do I use to do this? Just to lt you guys know, I know little about VBA or CDO. Also, I'm using gmail as IMAP.
    Last edited by koolx; Dec 19th, 2010 at 12:06 AM.

  2. #2
    Addicted Member
    Join Date
    Jul 2009
    Posts
    208

    Re: How Do I Send Attachments from Word Without Outlook?

    Try the Office forum and http://www.rondebruin.nl/cdo.htm

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2010
    Posts
    4

    Re: How Do I Send Attachments from Word Without Outlook?

    Quote Originally Posted by His Nibbs View Post
    Try the Office forum and http://www.rondebruin.nl/cdo.htm
    Hi, his nibbs.. the link you provided only works for excel, not word. And I need CDO with Word.

  4. #4
    Addicted Member
    Join Date
    Jul 2009
    Posts
    208

    Re: How Do I Send Attachments from Word Without Outlook?

    Have you tried it? Nothing in the code is specific to Excel. It should work in Word too.

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2010
    Posts
    4

    Re: How Do I Send Attachments from Word Without Outlook?

    Quote Originally Posted by His Nibbs View Post
    Have you tried it? Nothing in the code is specific to Excel. It should work in Word too.
    Hi, His Nibbs.. Yeah, I tried the code below. But, it looks like I cant send it rhough File>Mail Recipient. I think I need to create a userform. If you know how I can create one, please let me know. Thanks.

    vb Code:
    1. Sub SendMailCDO()
    2.  
    3. Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
    4. Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).
    5.  
    6. Const cdoAnonymous = 0 'Do not authenticate
    7. Const cdoBasic = 1 'basic (clear-text) authentication
    8. Const cdoNTLM = 2 'NTLM
    9.  
    10. Set objMessage = CreateObject("CDO.Message")
    11. objMessage.Subject = "Example CDO Message"
    12. objMessage.From = """Me"" <hidden>"
    13. objMessage.To = "hidden"
    14. objMessage.TextBody = "This is some sample message text.." & vbCrLf & "It was sent using SMTP authentication and SSL."
    15.  
    16. '==This section provides the configuration information for the remote SMTP server.
    17.  
    18. objMessage.Configuration.Fields.Item _
    19. ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    20.  
    21. 'Name or IP of Remote SMTP Server
    22. objMessage.Configuration.Fields.Item _
    23. ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
    24.  
    25. 'Type of authentication, NONE, Basic (Base64 encoded), NTLM
    26. objMessage.Configuration.Fields.Item _
    27. ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
    28.  
    29. 'Your UserID on the SMTP server
    30. objMessage.Configuration.Fields.Item _
    31. ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "hidden"
    32.  
    33. 'Your password on the SMTP server
    34. objMessage.Configuration.Fields.Item _
    35. ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "hidden"
    36.  
    37. 'Server port (typically 25)
    38. objMessage.Configuration.Fields.Item _
    39. ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
    40.  
    41. 'Use SSL for the connection (False or True)
    42. objMessage.Configuration.Fields.Item _
    43. ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
    44.  
    45. 'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
    46. objMessage.Configuration.Fields.Item _
    47. ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
    48.  
    49. objMessage.Configuration.Fields.Update
    50.  
    51. '==End remote SMTP server configuration section==
    52.  
    53. objMessage.Send
    54. End Sub
    Last edited by Hack; Dec 24th, 2010 at 08:36 AM. Reason: Added Highlight Tags

Posting Permissions

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



Click Here to Expand Forum to Full Width