Djblois
08-26-2011, 10:47 AM
I use this code to copy what the user has selected and then the add-in can paste it in the body of an email or in a pdf. However, if there is an picture within the range selected it does not copy over. Is it possible to copy over the image also but only if it is within that range:
If frmEmailWork.obWorksheet Then
Set rngeSend = Range(Cells(1, 1), Cells(fnFinalrow(wsWorking), fnFinalColumn(wsWorking)))
Else
Set rngeSend = Range(frmEmailWork.rfRange.Value)
End If
Set wsWorking = Worksheets.Add
rngeSend.SpecialCells(xlCellTypeVisible).Copy
wsWorking.Range("A1").PasteSpecial xlPasteValues
wsWorking.Range("A1").PasteSpecial xlPasteFormats
comResizeAndFit wsWorking 'Resize Columns and Change font to user selected
pagsetAdjustPageWidth False, False, wsWorking 'Adjust Page Width based on Total Column Widths
pagsetPrintHeading wsWorking, wsData.PageSetup.CenterHeader, wsData.PageSetup.LeftHeader, _ wsData.PageSetup.RightHeader
If frmEmailWork.obWorksheet Then
Set rngeSend = Range(Cells(1, 1), Cells(fnFinalrow(wsWorking), fnFinalColumn(wsWorking)))
Else
Set rngeSend = Range(frmEmailWork.rfRange.Value)
End If
Set wsWorking = Worksheets.Add
rngeSend.SpecialCells(xlCellTypeVisible).Copy
wsWorking.Range("A1").PasteSpecial xlPasteValues
wsWorking.Range("A1").PasteSpecial xlPasteFormats
comResizeAndFit wsWorking 'Resize Columns and Change font to user selected
pagsetAdjustPageWidth False, False, wsWorking 'Adjust Page Width based on Total Column Widths
pagsetPrintHeading wsWorking, wsData.PageSetup.CenterHeader, wsData.PageSetup.LeftHeader, _ wsData.PageSetup.RightHeader