mjohnston
07-21-2008, 11:37 PM
Hi All,
I'm hoping someone will be able to give me a hand.. I have inherited someones project which is a document which has a number of checkboxes at the top, and depending on which checkbox is selected a number of tables- which are inside bookmarks- and shown or hidden. This has unfortunately made the word doucment extremely slow to load (~2-3Minutes to open) and the show/hide functions can take ~40seconds-1min to load when a box is checked!
My question is, is this an inherent problem with using bookmarks and show/hide data within them, or is it more likely the code that has been written? I have included a small snippet below so you can get the jist of what is going on. Any feedback would be appreciated.
Personally I think that it could just be the way that it is written, but I haven't really worked with bookmarks before so its something I will have to look at. Please let me know if you want any additional info, or if it makes it easier I will send the document to someone if they would like to see the full thing!
Thanks in adavnce :)
Matt
Private Sub Selection_BI_CB_Click()
StripHiddenBookmarks
If Selection_BI_CB.Value = True Then
Module1.disable_all_apps
Selection_BI_CB.Enabled = True
Module1.non_super1_hide
Module1.areas_affected_disable
Set rng = Bookmarks("Extra_Space_BI1").Range
hide
Set rng = Bookmarks("Extra_Space_BI2").Range
hide
Set rng = Bookmarks("Extra_Space_BI3").Range
hide
Set rng = Bookmarks("Extra_Space_BI4").Range
hide
End If
If Selection_BI_CB.Value = False Then
Set rng = Bookmarks("Extra_Space_BI1").Range
show
Set rng = Bookmarks("Extra_Space_BI2").Range
show
Set rng = Bookmarks("Extra_Space_BI3").Range
show
Set rng = Bookmarks("Extra_Space_BI4").Range
show
Module1.enable_all_apps
Set rng = ThisDocument.Bookmarks("S1_Areas_Affected").Range
show
Set rng = ThisDocument.Bookmarks("KOL_Areas_Affected").Range
show
Set rng = ThisDocument.Bookmarks("STP_Areas_Affected").Range
show
Set rng = ThisDocument.Bookmarks("Nova_Areas_Affected").Range
show
Set rng = ThisDocument.Bookmarks("Eplat_Areas_Affected").Range
show
Set rng = ThisDocument.Bookmarks("EAI_Areas_Affected").Range
show
Set rng = ThisDocument.Bookmarks("Wizard_Areas_Affected").Range
show
Module1.non_super1_show
End If
End Sub
I'm hoping someone will be able to give me a hand.. I have inherited someones project which is a document which has a number of checkboxes at the top, and depending on which checkbox is selected a number of tables- which are inside bookmarks- and shown or hidden. This has unfortunately made the word doucment extremely slow to load (~2-3Minutes to open) and the show/hide functions can take ~40seconds-1min to load when a box is checked!
My question is, is this an inherent problem with using bookmarks and show/hide data within them, or is it more likely the code that has been written? I have included a small snippet below so you can get the jist of what is going on. Any feedback would be appreciated.
Personally I think that it could just be the way that it is written, but I haven't really worked with bookmarks before so its something I will have to look at. Please let me know if you want any additional info, or if it makes it easier I will send the document to someone if they would like to see the full thing!
Thanks in adavnce :)
Matt
Private Sub Selection_BI_CB_Click()
StripHiddenBookmarks
If Selection_BI_CB.Value = True Then
Module1.disable_all_apps
Selection_BI_CB.Enabled = True
Module1.non_super1_hide
Module1.areas_affected_disable
Set rng = Bookmarks("Extra_Space_BI1").Range
hide
Set rng = Bookmarks("Extra_Space_BI2").Range
hide
Set rng = Bookmarks("Extra_Space_BI3").Range
hide
Set rng = Bookmarks("Extra_Space_BI4").Range
hide
End If
If Selection_BI_CB.Value = False Then
Set rng = Bookmarks("Extra_Space_BI1").Range
show
Set rng = Bookmarks("Extra_Space_BI2").Range
show
Set rng = Bookmarks("Extra_Space_BI3").Range
show
Set rng = Bookmarks("Extra_Space_BI4").Range
show
Module1.enable_all_apps
Set rng = ThisDocument.Bookmarks("S1_Areas_Affected").Range
show
Set rng = ThisDocument.Bookmarks("KOL_Areas_Affected").Range
show
Set rng = ThisDocument.Bookmarks("STP_Areas_Affected").Range
show
Set rng = ThisDocument.Bookmarks("Nova_Areas_Affected").Range
show
Set rng = ThisDocument.Bookmarks("Eplat_Areas_Affected").Range
show
Set rng = ThisDocument.Bookmarks("EAI_Areas_Affected").Range
show
Set rng = ThisDocument.Bookmarks("Wizard_Areas_Affected").Range
show
Module1.non_super1_show
End If
End Sub