Dear Dave,
I am able to change the label text with the new text using the following code. Please see the source and output presentation.
It will work for equal length text. You need to investigate, how you can make it work for variable length text.
CODE:
==================================================================
Presentation pres = new Presentation(@"c:\source.ppt");
int cnt = pres.Slides.Count;
int totalCount = pres.Slides.Count + pres.Masters.Count;
Slide sld = pres.GetSlideByPosition(1);
OleObjectFrame oof = sld.Shapes[0] as OleObjectFrame;
string str = BytesToString(oof.ObjectData);
str=str.Replace("This is some text.", "MMMMMMMMMMMMMMMMM.");
byte[] newBytes = StringToBytes(str);
oof.ObjectData = newBytes;
pres.Write(@"c:\output.ppt");
-------------------------------------------------------------------------------------------------
//Bytes to String
public static string BytesToString(byte[] bytes)
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < bytes.Length; i++)
{
char ch = (char)bytes[i];
sb.Append(ch);
}
return sb.ToString();
}
//String to Bytes
public static byte[] StringToBytes(string str)
{
byte[] bytes = new byte[str.Length];
for (int i = 0; i < bytes.Length; i++)
{
bytes[i] = (byte)(str[i]);
}
//byte[] bytes = System.Text.Encoding.UTF8.GetBytes(str);
return bytes;
}
==================================================================