Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-05-2019, 02:54 AM
Browny38 Browny38 is offline Unsubscribe code for newsletter Windows 10 Unsubscribe code for newsletter Office 2016
Novice
Unsubscribe code for newsletter
 
Join Date: Jan 2019
Posts: 3
Browny38 is on a distinguished road
Default Newsletter in Word needs an unsubscribe vb code for a button.

Hi I feel I am getting close to the answer with this code, but it still needs to be corrected.

Private Sub CommandButton1_Click()
Dim OL As Object
Dim EmailItem As Object
Dim abc As String
'To add to a Word newsletter an Unsubscribe button
Application.ScreenUpdating = False
Set OL = CreateObject("Outlook.Application")


Set EmailItem = OL.CreateItem(olMailItem)
Application.UserName = "abc"
With EmailItem
.Subject = "Unsubscribed"
.Body = "This person has unsubbed"
.To = "my email@xzy.com"
.Importance = olImportanceNormal
.Attachments.Add abc
.Send
End With
Application.ScreenUpdating = True
End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unsubscribe code for newsletter Electronic Newsletter MaineLady Word 1 09-11-2016 06:16 PM
Problems sending html newsletter vanderloo Outlook 0 11-08-2012 11:31 AM
unneccesary gap in newsletter, please help! slain Outlook 0 05-07-2011 03:44 AM
Email marketing help - "Unsubscribe" Footer DoughMan Outlook 0 04-06-2011 10:57 AM
Unsubscribe code for newsletter Curve the Text Box in a Newsletter? lewiedude Publisher 2 11-08-2005 08:52 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:27 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft