C
cvil0603
Does anyone know how to check if a slide name already exists, I'm using
macro to add new slides and assigning slidenames from an xml file. Any
suggestions?
part of the code:
For Each rootNode In root
Set statusNode = rootNode.SelectSingleNode("status")
statusName = statusNode.FirstChild.nodeValue
Set groupNode = rootNode.SelectSingleNode("group")
Set titleNode = rootNode.SelectSingleNode("title")
Set categNode = rootNode.SelectSingleNode("category")
categName = categNode.FirstChild.nodeValue
Set linkNode = rootNode.SelectSingleNode("hyperlink")
Set descNode = rootNode.SelectSingleNode("description")
Dim theSlide
Dim findSlide
If Not groupNode Is Nothing Then
groupName = groupNode.FirstChild.nodeValue
linkName = linkNode.FirstChild.nodeValue
If Not ActivePresentation.slides.Count < 3 Then
For Each theSlide In ActivePresentation.slides.Range
'MsgBox theSlide.Name & ":" & theSlide.SlideID & ": " &
groupName
If Not theSlide.Name = linkName Then ' <<<------ (doesn't
work) --->>>
With
ActivePresentation.slides.Add(ActivePresentation.slides.Count + 1,
ppLayoutBlank)
.Name = linkName
'MsgBox .Name
With
..Shapes.AddTextbox(msoTextOrientationHorizontal, 40, 40, 600, 30)
.TextFrame.TextRange.Text = groupName &
linkName
.Width = 300
.Name = groupName
.TextFrame.TextRange.ParagraphFormat.Alignment
= ppAlignLeft
With .TextFrame.TextRange.Font
.Name = "Verdana"
.Size = 32
.Color = RGB(0, 25, 101)
End With
End With
macro to add new slides and assigning slidenames from an xml file. Any
suggestions?
part of the code:
For Each rootNode In root
Set statusNode = rootNode.SelectSingleNode("status")
statusName = statusNode.FirstChild.nodeValue
Set groupNode = rootNode.SelectSingleNode("group")
Set titleNode = rootNode.SelectSingleNode("title")
Set categNode = rootNode.SelectSingleNode("category")
categName = categNode.FirstChild.nodeValue
Set linkNode = rootNode.SelectSingleNode("hyperlink")
Set descNode = rootNode.SelectSingleNode("description")
Dim theSlide
Dim findSlide
If Not groupNode Is Nothing Then
groupName = groupNode.FirstChild.nodeValue
linkName = linkNode.FirstChild.nodeValue
If Not ActivePresentation.slides.Count < 3 Then
For Each theSlide In ActivePresentation.slides.Range
'MsgBox theSlide.Name & ":" & theSlide.SlideID & ": " &
groupName
If Not theSlide.Name = linkName Then ' <<<------ (doesn't
work) --->>>
With
ActivePresentation.slides.Add(ActivePresentation.slides.Count + 1,
ppLayoutBlank)
.Name = linkName
'MsgBox .Name
With
..Shapes.AddTextbox(msoTextOrientationHorizontal, 40, 40, 600, 30)
.TextFrame.TextRange.Text = groupName &
linkName
.Width = 300
.Name = groupName
.TextFrame.TextRange.ParagraphFormat.Alignment
= ppAlignLeft
With .TextFrame.TextRange.Font
.Name = "Verdana"
.Size = 32
.Color = RGB(0, 25, 101)
End With
End With