Page Displays LARGE bug

D

Don Maloney

WHen opening a document I get a LARGE bug displayed.
Others opening the document get a LARGE apple.
I opened a new document and did compare.
THe discrepancy is in Borders with a size 256.
Going to Borders and Shading at each click I get an error
"measurement must be between 1 and 31"
Click on options errors Word and terminates sessio.
It may be a picture embedded in the border.
How can I delete the border or revise the setting so that the border can be
stripped.
Can this be revised in a macro. so I can paste it in and run it to delete
the border?
Thanks

Don
 
K

Klaus Linke

Hi Don,

If you're using Word2003, save as XML and reopen the file. Maybe that forces
Word to fix the setting that is out of bound.

It's hard to say what "measurement must be between 1 and 31" refers to
without looking at the document.
Probably the ArtWidth of section borders... You could try if the macro below
fixes things:

' (fixes only current section)
Dim myBorder As Border
For Each myBorder In Selection.Sections(1).Borders
With myBorder
If .ArtWidth < 1 Then .ArtWidth = 1
If .ArtWidth > 31 Then .ArtWidth = 31
End With
Next myBorder

Or to get rid of the art border completely:
Selection.Sections(1).Borders.Item(wdBorderBottom).ArtStyle = 0

:-/ Not sure if there's a better way to remove the art border... and if the
above line is the proper way, there should be a constant wdArtNone=0

If you're not familiar woth macros, see
http://www.word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm

If that doesn't work, you might send me the file.

Regards,
Klaus
 
D

Don Maloney

Hi Klaus,

GOt an out of range errror
..Artwidth shows as 5100 when I put cursor over Artwidh variable in th line
If .ArtWidth > 31 Then .ArtWidth = 31

And Same error on the ArtStyle = 0 line

Aparently someone entered a border with a picture size 256.

The 1 to 31 measurement is the maximum z=size MS allows borders to be
Obviously someone bypassed any MS error checking and set the border to be
large.
But the usual MS border settings will not work.

Thanks for trying.

If you want a copy send me your email address.
Mine is (e-mail address removed)

Don
 
G

Grettl

Don and Klaus
I am experiencing the same issue - see the question I posted.
Do you guys have any updates on how to resolve this?

S
 
D

Don Maloney

Grettl,

how'd you getthe document in the first place?

I think this macro may work it should copy the document data to a new
document without the borders.
Let me know how it workes with your docs.

Sub CopyText()
Dim sec As Section
Dim Doc1 As Document
Dim Doc2 As Document
Dim rng1 As Range
Dim rng2 As Range

Set Doc1 = ActiveDocument
Set Doc2 = Documents.Add("GoodTemplate")
For Each sec In Doc1.Sections
Set rng1 = sec.Range

rng1.MoveEnd wdCharacter, -1
rng1.Copy
Set rng2 = Doc2.Range
rng2.Collapse wdCollapseEnd
rng2.Paste
rng2.End = Doc2.Range.End
rng2.Collapse wdCollapseEnd
rng2.Select
If rng1.End < Doc1.Range.End - 1 Then
rng2.InsertBreak wdSectionBreakNextPage
End If
Next sec
End Sub
 

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