Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-29-2018, 10:20 AM
mfiltvedt84 mfiltvedt84 is offline Remove visible command button when attaching in outlook Windows 10 Remove visible command button when attaching in outlook Office 2016
Novice
Remove visible command button when attaching in outlook
 
Join Date: Sep 2018
Posts: 6
mfiltvedt84 is on a distinguished road
Default Remove visible command button when attaching in outlook

See this code.
This works but Im trying to make the command button im pushing in the sheet, not visible when the sheet has been converted to pdf and attached in outlook. How do I remove the visible command button in the pdf..???

Private Sub CommandButton1_Click()
' Create PDF of active sheet and send as attachment.
'
Dim strPath As String, strFName As String
Dim OutApp As Object, OutMail As Object

'Create PDF of active sheet only
strPath = Environ$("temp") & "\" 'Or any other path, but include trailing "\"

strFName = ActiveWorkbook.Name
strFName = Left(strFName, InStrRev(strFName, ".") - 1) & "_" & ActiveSheet.Range("D7") & ".pdf"

ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
strPath & strFName, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False

'Set up outlook


Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

'Create message
On Error Resume Next
With OutMail
.to = Range("L13") 'Insert required address here ########
.CC = ""
.BCC = ""
.Subject = "Interiør solskjerming Tilbud"
.Body = ""
.Attachments.Add strPath & strFName
.Display 'Use only during debugging ##############################
'.Send 'Uncomment to send e-mail ##############################
End With

'Delete any temp files created
Kill strPath & strFName
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Show table list by using chek box command and save document on sharepoint by using command button Zhibek Word VBA 3 08-16-2018 06:19 PM
can't remove page break that isn't visible in nonprinted characters georgiajmj49 Word 8 07-19-2018 03:27 AM
Outlook 'Start Page' Command Button Wobble Outlook 0 03-31-2015 04:49 AM
Help with a Command Button dkohnken Word VBA 5 03-18-2015 10:13 PM
Command Button knp11 PowerPoint 2 01-18-2015 01:41 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:50 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