Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>My understanding is that you have control over how XML file gets embedded into PowerPoint presentation in the first place. Here I do not quite understand why you chose to keep the data you need as <em>contents</em> of an embedded object.</p> <p>To be sure, the task of getting those contents back is not a piece of cake. Actually, as long as there is no (simple or even moderately difficult) way to call <code>QueryInterface</code> and use <code>IPersist*</code> interfaces from VBA, there is just one way to get to contents of embedded object. The way involves following steps:</p> <ol> <li>Activate an embedded object. You used <code>OLEFormat.DoVerb 1</code> for that. A better way would be to call <code>OLEFormat.Activate</code>, but this is irrelevant for your particular problem.</li> <li>Use embedded object's programming model to perform useful operations like getting contents, saving or whatever is exposed. <code>Notepad.exe</code> exposes no such programming model, and you resorted to <code>WinAPI</code> which is the best choice available.</li> </ol> <p>Unfortunately, your current approach has at least 2 flaws:</p> <ol> <li>The one you identified in the question (activation of <code>notepad.exe</code> leading to possibility of user's interference).</li> <li>If a user has default program for opening <code>.txt</code> files other than <code>notepad.exe</code>, your approach is doomed.</li> </ol> <p>If you do have control over how embedded object is created then better approach would be to store your XML data in some property of <code>Shape</code> object. I would use <a href="http://msdn.microsoft.com/en-us/library/office/bb265694.aspx" rel="nofollow"><code>Shape.AlternativeText</code></a> (very straightforward to use; shouldn't be used if you export your <code>.pptm</code> to HTML or have some different scenario where <code>AlternativeText</code> matters) or <a href="http://msdn.microsoft.com/en-us/library/office/bb265778.aspx" rel="nofollow"><code>Shape.Tags</code></a> (this one is probably the most semantically correct for the task) for that.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload