We have a MS Access 365 form with a bound object frame, which is bound to a Varbinary(Max) column in the back end Azure SQL database.
The form was set up initially as a very quick fix so that users could paste screen shots from the snipping tool which would then be embedded in the database. However it now appears that users have been copying and pasting entire word documents, excel spreadsheets etc or segments of them.
Is there any way of programmatically determining the type of object which has been embedded for each record? We need to separate screen snips from all other types of object (Word/Excel etc.)
I am assuming there must be something, as if I loop through the records one at a time in the form and right click on the bound object frame, any Word/Excel etc objects give me the option of opening/editing the object, whereas if a screen snip has been pasted in, it doesn't.
Any help is very much appreciated, thanks! Jim
The following code will do what you want. Substitute oleImage with the name of your bound object frame. The best place would probably be in the BeforeUpdate event:
You can also interrogate the contents of the clipboard. Create a new module and copy the code at the bottom of this answer in there. You can then call the function fCheckClipBoardDataType as follows to see if the content matches what you want.
In your case, it would be CF_BITMAP to start with. Depending on your needs, you may also need to check for CF_DIB and CF_DIBV5 but probably not (see https://learn.microsoft.com/en-us/windows/win32/dataxchg/standard-clipboard-formats for details of clipboard formats):