programmatically set border width to 2 pt

A

Alan Wang

Hi there,

How can I programmatically set border width to 2 pt in MS word xp or 2003.
It's hard because there is no pre-defined 2pt border width in MS word.

Please help!

Alan
 
C

Cindy Meister

The border width of WHAT? Many different things can have borders in Word...

-- Cindy
 
A

Alan Wang

Sorry I didn't make myself clear last time. My question is how to
programmatically set border width of borders to 2pt.

Thanks

Alan
 
C

Cindy Meister

Yes. What kinds of borders? Borders around drawing objects? Table cells?
Frames? Paragraphs? A page? Something else?

-- Cindy
 
C

Cindy Meister

Hi Alan

No, there's no way to set customizable line widths for this type of border.

-- Cindy
 
A

Alan Wang

Thanks for posting back.

My question is what type of border which be able to set customizable line
widths. By the way I tried to use table and set up border width and it's
not working neither.

Thanks

Alan
 
C

Cindy Meister

Only the Drawing tools (what you can use with items in the Shapes collection)
support this line weight. In the UI, draw a line or a box using the Drawing
toolbar, then right-click and choose "Format".

Bit of sample code (VBA): Selection.ShapeRange(1).Line.Weight = 5

Without knowing exactly what you want to do, and in which version of Word,
it's difficult to make a suggestion. You could, perhaps, use a Textbox
drawing object.

Theoretically, it's also possible to draw a rectangle around text in the
text flow. The tricky part, though, is making sure it always moves with that
text, both horizontally and vertically.

-- Cindy
 
A

Alan Wang

Without knowing exactly what you want to do, and in which version of
This application actually designs for newspaper industry to create
classified AD and the reason we really care about border width is we need MS
word returns number of inches back to calculate price for the customer.We
are using word xp or word 2003 version.

Alan
 
C

Cindy Meister

Hi Alan

Well, besides using TextBoxes (which might actually be better for this), the
only other thing that occurs to me would be to use Table cells with a set
height/width. Apply the next smaller size border. AND set the cell padding to
compensate for the missing .5 pts (or whatever you choose).

I tend to question, however, whether Word is the correct tool for newspaper
design (layouting). It's a Word processor, which means certain layouting
principles simply aren't there. Microsoft Publisher might be the better tool,
and it has a programming interface. Just something to think about :)

-- Cindy
 
A

Alan Wang

Cindy:

Thank you again for posting back.

I will try it today and keep you posted


We are using word just for upsells purpose only and we are using Adobe
Indesign to do the layout pagination.

By the way do you know how to enable multi-thread for MS word?

Alan
 
C

Cindy Meister

Hi Alan

I saw that question <g>, and decided to avoid it, because I don't KNOW the
answer. I think I remember seeing a similar disucssion, in one of these
office.developer groups, months ago. If I recall correctly, it was initiated
by an MSDN subscriber, so an MSFT support person (like Peter Huang, maybe)
jumped in.

If that is what I'm remembering, then the answer is certainly, "No, it can't
be done". If I'm not recalling the exact details, the answer was still "No"
:) But since I am a little vague on the source, I don't want to come right
out and say it in front of the entire world.

-- Cindy
 
A

Alan Wang

Cindy:

I am just wondering if MS fixed this error in word 2003 SP1 which is
released August 20, 2004.

Alan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top