Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-12-2019, 05:30 PM
poetofpiano poetofpiano is offline Run Time Error 5843 When Applying Border Windows 10 Run Time Error 5843 When Applying Border Office 2016
Novice
Run Time Error 5843 When Applying Border
 
Join Date: Sep 2015
Posts: 25
poetofpiano is on a distinguished road
Default Run Time Error 5843 When Applying Border

I have a macro that applies a border as follows:

Code:
With Selection
    With .Borders(wdBorderLeft)
        .LineStyle = wdLineStyleSingle 
        .LineWidth = Options.DefaultBorderLineWidth
        .Color = Options.DefaultBorderColor
    End With
    With .Borders(wdBorderRight)
        .LineStyle = wdLineStyleSingle
        .LineWidth = Options.DefaultBorderLineWidth
        .Color = Options.DefaultBorderColor
    End With
    With .Borders(wdBorderTop)
        .LineStyle = wdLineStyleSingle 
        .LineWidth = Options.DefaultBorderLineWidth
        .Color = Options.DefaultBorderColor
    End With
    With .Borders(wdBorderBottom)
        .LineStyle = wdLineStyleSingle 
        .LineWidth = Options.DefaultBorderLineWidth
        .Color = Options.DefaultBorderColor
    End With
End With
It works fine when I have selected about a page worth of text. However, when I select around two pages worth and run the code, I get "Run Time Error 5843: one of the values passed to this method or property is out of range." Can anyone offer any help? Thank you so much!
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word Error Message Run time Error 4605 baes10 Word VBA 1 08-30-2018 02:37 PM
Applying individual border sides to images when pasted into a table Duvdev Word VBA 1 03-27-2014 03:12 AM
Get Run-time Error 11 Jamtart PowerPoint 2 08-31-2012 05:04 AM
Does Word do this when applying Styles to a paragraph a second time? Bobosmite Word 2 04-17-2012 02:13 PM
Word Visual Basic error - run time error 504 crazymorton Word 11 01-13-2012 04:32 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:39 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft