zxmon21
03-04-2012, 03:26 PM
Hi,
I am trying to mark a shape (by changing fill to red), then ask the user if this is the shape we are looking for, and then restore the original fill style.
Any ideas how to save and restore the fill style of a shape? It could be a complex fill like gradients etc, so I'd rather not just save the BackColor.RGB.
What I'm doing now throws an error "Object required"
Any help is much appreciated :)
'save runshp.background color in dummy variable
OldBg = runshp.Fill '<-- This line throws an error
runshp.Fill.BackColor.RGB = RGB(255, 0, 0)
'throw a messagebox asking if this is the right shape selected
If MsgBox("I think I detected a chapter title, but am not quite sure. Is it the shape I labelled in red?", vbYesNo) = 6 Then
runshp.Name = "ChapterTitle"
'this is it
End If
runshp.Fill = OldBg '<-- I bet this will also throw an error
I am trying to mark a shape (by changing fill to red), then ask the user if this is the shape we are looking for, and then restore the original fill style.
Any ideas how to save and restore the fill style of a shape? It could be a complex fill like gradients etc, so I'd rather not just save the BackColor.RGB.
What I'm doing now throws an error "Object required"
Any help is much appreciated :)
'save runshp.background color in dummy variable
OldBg = runshp.Fill '<-- This line throws an error
runshp.Fill.BackColor.RGB = RGB(255, 0, 0)
'throw a messagebox asking if this is the right shape selected
If MsgBox("I think I detected a chapter title, but am not quite sure. Is it the shape I labelled in red?", vbYesNo) = 6 Then
runshp.Name = "ChapterTitle"
'this is it
End If
runshp.Fill = OldBg '<-- I bet this will also throw an error