Click here to Skip to main content
15,885,782 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
WordDoc.Shapes.AddShape(1, 30, 15, 565, 760).ShapeStyle = "Colored Outline - Black,Dark 1"

I used this code above to make an rectangle into a word document using vs2010,but I have a problem because I don't know how to set shape style at "NO FILL".

This is an no fill shape style in word2010 but I don't know how to use:
""Colored Outline - Black,Dark 1"
Posted
Updated 8-Nov-12 9:30am
v2

1 solution

You must assign a MsoShapeStyleIndex to the ShapeStyle.

To get a rectangle with No fill and black border Try this

C#
WordDoc.Shapes.AddShape(1, 30, 15, 565, 760).ShapeStyle = Microsoft.Office.Core.MsoShapeStyleIndex.msoLineStylePreset1;

The enum MsoShapeStyleIndex has many more options, try them to get your desired shape.
 
Share this answer
 
Comments
blueye89 8-Nov-12 16:45pm    
:) Thank you my friend!!..That's solution.Did you know how to change weight of line to 1pt?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900