1
votes

I'm trying to access Outlook attachments from clipboard using VBA to further process the file.

The user copies an attachment to the clipboard (Right click -> Copy), opens PowerPoint, clicks a buttons and gets the presentation inserted a the end of the document.

The key part seems to access the PowerPoint file in the clipboard an save it on the file system.

Can someone help and provide a sample code for this using VBA in PowerPoint?

Many thanks!


I've found a way achieve it.

  1. Getting filenames: Solution has been posted here: http://www.access-o-mania.de/forum/index.php?topic=17045.15

  2. Getting the content

    • file size in clipboard can be obtained by GlobalSize(handle)
    • pointer the by GlobalLock(handle)
    • content using CopyMemory(destination, source, length)
1
How does Outlook come into play here?David G
As far as I've understood so far, Outlook copies files to the clipboard in a different way compared to the explorer.tmp_hallenser

1 Answers

0
votes

Look at the clipboard contents with an app like ClipSpy. Since there is no physical file to be copied, the full file path is not included (no CF_HDROP format). But FileGroupDescriptor and FileContents formats are there.