以下代码是 如何便利Pagelayout 里面的Graphics Element
IGraphicsContainer pGraphicsContainer = pPageLayout as IGraphicsContainerSelect;
pGraphicsContainer .Reset();//记住一定要有这句话,否则下面的next 返回空
IElement element = pGraphicsContainer.Next();
if (element != null)
{
//.....do something
element = pGraphicsContainer.Next();
}
还有一个类 IGraphicsContainerSelect 这个是用来遍历 用户当前选中的Element,不要搞混了哦