Search code examples
c#office-interoppowerpoint-2007

Change the target of a linked video causes the trim function stop working


I am changing the target video in a linked video in PowerPoint 2010, but the problem comes when the original video was trimmed using the trim function so since I am just changing the target video it makes sense that the trim function still there after the relink, but is gone, and I need to keep the trim in the video shape. My code looks like:

Newfile= "\\newvideo.avi"; Shape.LinkFormat.SourceFullName = newfile; Shape.Name = Path.GetFileName(newfile);


Solution

  • The shape's .MediaFormat object will give you the .StartPoint and .EndPoint (ie, trim points).

    Pick those up before changing the link and reapply them after; I think that should solve the problem.