使用VB.NET代码锁定了所需的形状以在Power Point 2007中进行选择? [英] requested shapes are locked for selection in power point 2007 using VB.NET code ?
问题描述
错误消息:所请求的形状被锁定以供选择.
使用VB.NET代码锁定了所需的形状以在Power Point 2007中进行选择?在上传Powerpoint演示文稿2007时?我正在使用VB.NET Presentation Engine应用程序上载Power Point 2007吗?上载了一些Powerpoint演示文稿,有些演示文稿会产生问题.
在上载Problem Power Point Presentation 2007时,我可以看到一些幻灯片以选择for循环,但是某些特定的幻灯片却给我一个错误,即请求的形状被锁定以供选择,这将导致异常.如果我删除那张幻灯片,那么我的Power Point 2007就上传了.我没有得到什么设置,所以它给了我异常.我的代码如下:-\
Error Message: Requested shapes are locked for selection.
requested shapes are locked for selection in power point 2007 using VB.NET code ? while uploading Power point presentation 2007 ? I am uploading power point 2007 using VB.NET Presentation Engine Application ? Some of Power point Presentation Uploaded, and some presentation create Problem.
While uploading Problem Power Point Presentation 2007 some slides i can visualise to select in for loop, but some specific slides gives me error that requested shapes are locked for selection and it goes to exception. If i delete that one slide then my Power Point 2007 uploaded. I am not getting what setting have made so it gives me that exception.My code for this is below:-\
For y As Integer = 1 To objPres.Slides.Count
Dim sl As Slide = objPres.Slides(y)
For Each sh In sl.Shapes
If sh.Type = msoLinkedOLEObject Or sh.Type = msoChart Then
log.Info("Accessing SourceFullName property of the link...")
Dim linkExcel As String
Try
linkExcel = sh.LinkFormat.SourceFullName
Catch ex As Exception
log.Info("Exception when getting source full name", ex)
Continue For
End Try
log.Info("SourceFullName property of the link returned : " & linkExcel)
Dim fileURLorUNC As String = String.Empty
Dim m1, m2 As Match
m1 = Regex.Match(linkExcel, "(http[s]{0,1}://.+)", RegexOptions.IgnoreCase) '' Should match an http(s)://... link
m2 = Regex.Match(linkExcel, "(.+\\){0,1}(.+?\.xlsx)(!){0,1}", RegexOptions.IgnoreCase) '' Should match: \\ps4929\htdocs\LeavePlan.xls; F:\LeavePlan.xls (absolute path). If ! mark is there at the end, then also we want its previous path only.
If m1.Success Then
fileURLorUNC = m1.Groups(1).Value
ElseIf m2.Success Then
fileURLorUNC = m2.Groups(1).Value & m2.Groups(2).Value
End If
If m1.Success Or m2.Success Then
dtLinks.Rows.Add(New Object() { _
sl.SlideID, _
sh.Id, _
fileURLorUNC, _
String.Empty, _
String.Empty, _
String.Empty})
End If
End If
Next
Next
谁能指导我.
谢谢,
Mangesh:-)
Can anyone guide me on.
Thanks,
Mangesh :-)
推荐答案
看看此VBA(不是vb.net)代码可能会带您上路:
http://www.pptfaq.com/FAQ00860.htm [
Have a look at this VBA (not vb.net) code that might get you on your way:
http://www.pptfaq.com/FAQ00860.htm[^]
Good luck!
这篇关于使用VB.NET代码锁定了所需的形状以在Power Point 2007中进行选择?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!