Sub SetBackgroundColor() Dim mxDoc As IMxDocument Set mxDoc = ThisDocument Dim map As IMap Set map = mxDoc.FocusMap Dim layout As IPageLayout Set layout = mxDoc.PageLayout Dim gc As IGraphicsContainer Set gc = layout gc.Reset Dim element As IElement Set element = gc.Next Do While Not element Is Nothing If TypeOf element Is IMapFrame Then Dim mapFrame As IMapFrame Set mapFrame = element If mapFrame.map Is map Then Dim background As IBackground Set background = mapFrame.background Dim symbolBackground As ISymbolBackground Set symbolBackground = background Dim fillSymbol As IFillSymbol Set fillSymbol = symbolBackground.fillSymbol Dim color As IRgbColor Set color = New RgbColor color.Red = 255 color.Green = 0 color.Blue = 0 fillSymbol.color = color symbolBackground.fillSymbol = fillSymbol mapFrame.background = background mxDoc.UpdateContents mxDoc.ActiveView.Refresh End If End If Set element = gc.Next Loop End Sub
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.