PDA

View Full Version : Convert Userform with a scrollbar into pdf



trishgyrl
01-13-2018, 07:58 AM
Hello. Please help.

I used some of the coding techniques found in other threads. It works fine for smaller forms except my form is longer and I had to put a scrollbar in so users can enter additional data.

Is there a way for the pdf to show all data in the form?

I am stumped. Any help is greatly appreciated.


Here is what I have:



Public Sub SavePDF()
Dim myPath As String
Dim myName As String
Dim myfile As String

myPath = "P:\"
DoEvents
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY + KEYEVENTF_KEYUP, 0
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY + KEYEVENTF_KEYUP, 0
DoEvents
Workbooks.Add
Application.Wait Now + TimeValue("00:00:01")

With ActiveSheet
myName = CreateProduct.txtFPA.Value
.Name = myName
.PasteSpecial Format:="Bitmap", Link:=False, DisplayAsIcon:=False
.PageSetup.Orientation = xlPortrait
.PageSetup.FitToPagesWide = 1
.PageSetup.Zoom = False
.ExportAsFixedFormat Type:=xlTypePDF, Filename:=myPath & myName & ".pdf", Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
End With
ActiveWorkbook.Close False

myfile = myPath & myName & ".pdf"

Call Send_Mail(myfile)
Kill myfile
End Sub