我想在程序1,选中给颜色赋值13260,否则赋值vbblue;程序2调用颜色值 '程序1 Public Sub OptionButton1_Click() Dim YANSE AsVariant IfOptionButton1.Value = 1 Then YANSE =13260 Else YANSE = vbBlue End If End Sub '程序2 Sub 组合() Application.ScreenUpdating =True Dim j As InlineShape For Each j InActiveDocument.InlineShapes With j If .Type =wdInlineShapePicture Then .LockAspectRatio= msoTrue End If End With '图片边框,粗细和颜色 With j.Line .Visible = msoTrue .Weight = 1.5 ' .ForeColor.RGB =13260 .ForeColor.RGB= YANSE End With '图片居中 Withj.Range.ParagraphFormat .Alignment =wdAlignParagraphCenter .LeftIndent =CentimetersToPoints(0) .FirstLineIndent = CentimetersToPoints(0) .CharacterUnitFirstLineIndent = 0 .FirstLineIndent = CentimetersToPoints(0) .CharacterUnitFirstLineIndent = 0 End With Next j MsgBox "已完成'"
End Sub
|