Hi James,
I have observed your comments and like to share with you that both issues are unresolved at the moment. I am discussing with our product team if these issues could be scheduled for further investigation and resolution soon because they were logged quite some time ago. I will share our findings with you as soon as the feedback is shared by our product team.
We are sorry for your inconvenience,
Hello,
thank you for the update.
I need to use the Active X controls because I want to have placeholders where I can read/write information like author, revision, last change date, etc…
Textboxes in Powerpoint do not have any properties where I can set a unique name to address it, or am I wrong? If I can use any other textbox like feature in Powerpoint where I can reach my requirement I can switch to it and do not use the Active X controls at all. Any ideas?
Hi Yves Rausch,
Hello,
finding the shapes will work like you said, but it seems it is not possible to replace or update the text?
Only article I found is:
Find and Replace Text without Losing Format in Presentation|Aspose.Slides Documentation
But there I will need VSTO/Powerpoint, so it won’t work for me.
EDIT Forget this post Or delete it ( I can’t ), scrolling down on a side will help…
Handling Powerpoint seems much more difficult at it seems at the start…
I have code to identify the shape and set the name (works!):
// special procedure to set shape names
foreach (var slide in presentationSlides)
{
for (int i = 0; i < slide.Shapes.Count; i++)
{
if ((slide.Shapes[i].AlternativeText.Contains("{{") && slide.Shapes[i].AlternativeText.Contains("}}")))
{
slide.Shapes[i].Name = slide.Shapes[i].AlternativeText.Replace("{{", “”).Replace("}}", “”);
slide.Shapes[i].AlternativeText = “”;
}
}
}
If I save the document and check it the shape will have the alternative text removed and the shape has the name now (was checking the shape.xml inside the document).
Getting all shape names like this:
// Shapes
result = presentationSlides.Aggregate(result, (current1, slide) => slide.Shapes.Where(t => t.Name.Length > 0).Aggregate(current1, (current, t) => current + (t.Name + “,”)));
But now I want to select a shape by name and get/set its content. As I do not found any methods for this I tried this code, but do not work:
public void SetFormFieldValue(string name, string value)
{
if (_path.Length == 0) return;
//Get all text boxes in the presentation
ITextFrame[] tb = SlideUtil.GetAllTextFrames(_presentation, true);
foreach (var t in tb)
{
foreach (Paragraph para in t.Paragraphs)
{
if (t.AsISlideComponent.Slide.Name == name)
para.Text = value;
}
}
}
public string GetFormFieldValue(string name)
{
if (_path.Length == 0) return “”;
var presentationSlides = _presentation.Slides;
//Get all text boxes in the presentation
var tb = SlideUtil.GetAllTextFrames(_presentation, true);
foreach (var t in tb)
{
foreach (Paragraph para in t.Paragraphs)
{
_logger.ToLog("Get: " + t.AsISlideComponent.Slide.Name, Company, name, Logfile);
if (t.AsISlideComponent.Slide.Name == name)
return para.Text;
}
}
// ActiveX controls
foreach (ISlide presentationSlide in presentationSlides)
{
var controls = presentationSlide.Controls;
foreach (IControl control in controls)
{
if (control.Name == name && control.Properties != null)
{
//_logger.ToLog(control.Name, Company, control.Properties[“Text”], Logfile);
return control.Properties[“Text”];
}
}
}
return “”;
}
So what I do wrong?
Hi,
I have observed your code. You are in fact trying to get or set the text on paragraph level. When you set the text on paragraph level, the font properties gets reset. In order to retain the textual properties you need to get or set the font on portions level. Every paragraph has collection of portion inside it. The portions in paragraph are added on the basis of any change in font properties of text include its size, color, boldness, italicizing, underlining and other properties. Please visit this documentation link for your kind reference in this regard for more insight about portions. If there is still an issue then please share the working sample project, source presentation and generated presentation with us. Please also provide the desired output presentation that you are failing to get. I will investigate that further on my end to help you out.
Many Thanks,
Hello,
any news on the two bugs on plan to resolve them?
Hi,
Still waiting for these fixes, would be nice if they are get fixed in one of the next updates.
Hi Yves Rausch,
I have discussed the issue status with our product team. Actually, the issue is blocked owing to internal limitation of ActiveX controls. The issue is likely to get resolved in Aspose.Slides for .NET 16.5.0. I will really appreciate your patience in this regard till the time the issue gets resolved.
We are sorry for your inconvenience,
Hello,
did a test with 16.5.0 yesterday, set text of a ActiveX field still make the PowerPoint file corrupt.
Hi Yves,
I have verified the issue status from our issue tracking system and regret to share that at present the issue is still unresolved. We request you to be please be patient and we will share the feedback with you as soon as the issue will be fixed.
We are sorry for your inconvenience,
Any news on plans fix this?
Hi Yves,
Ok, ActiveX support won’t be necessary when the other solution works (embed Word in PowerPoint) from my other thread.
Hi Yves,
BUMP
Status about SLIDESNET-34966 and SLIDESNET-36103 ??
Hi,
We are sorry for your inconvenience,
Any new status update?
I can’t support PowerPoint in my app since 2 years now… you did post it gets fixed in Q1 2018 but we can be sure about this? In Q1 I need to renew my Total.Net subscription, will make this mandatory to his.
Please accept my apologies for inconvenience on your end. I like to share that I have shared tentative ETA with you and we are hopeful to have ActiveX required support available by then to resolve your issues. Secondly, if your subscription gets expired by the time the issue gets fixed then in that case you may need to renew your subscription to avail the feature support.