HollowMan19xx
New Member
- Joined
- Sep 27, 2013
- Messages
- 13
I have a signature form on a tablet that takes the input strokes and then displays them as a picture object (as opposed to an ActiveX shape, which I try to avoid because they can drastically slow down the underlying code). A second technician can add his signature by opening the form, which then brings up the existing signature as the InkPicture background. The two are then combined, ad infinitum.
Here's the problem... there doesn't seem to be a way in VBA (as far as I know, but I'm no expert!) to save the existing picture as a file that can then be assigned as the InkPicture background. So the workaround is to select the picture, copy, insert a chart, paste into the chart, export the chart as a .gif, THEN assign it as the InkPicture background.
Yuck!
My existing code is below, but I get an "Invalid Property Value" error.
The elegant solution would be to assign the InkPicture background from a picture copied to the clipboard.
Does anyone know if this can be done?
Here's the problem... there doesn't seem to be a way in VBA (as far as I know, but I'm no expert!) to save the existing picture as a file that can then be assigned as the InkPicture background. So the workaround is to select the picture, copy, insert a chart, paste into the chart, export the chart as a .gif, THEN assign it as the InkPicture background.
Yuck!
My existing code is below, but I get an "Invalid Property Value" error.
The elegant solution would be to assign the InkPicture background from a picture copied to the clipboard.
Does anyone know if this can be done?
Code:
Selection.CopyPicture Appearance:=xlPrinter, Format:=xlPicture
Set cht = ActiveSheet.ChartObjects.Add(0, 0, rng.Width - 1, rng.Height - 1)
cht.Chart.Paste
cht.Chart.Export tempdir & "\" & "Sig_Old.gif"
cht.Delete
'Load existing old signature into background of InkPicture...
SignatureForm.InkPicture1.Picture = LoadPicture(tempdir & "\" & "Sig_Old.gif")