Private Sub pass_unlock()
'Unlocks the form. DO NOT CHANGE THE PASSWORD
If activedocument.ProtectionType <> wdNoProtection Then
activedocument.Unprotect Password:="####"
End If
End Sub
Private Sub pass_lock()
'Locks the form. DO NOT CHANGE THE PASSWORD
activedocument.Protect Type:=wdAllowOnlyFormFields, noreset:=True, Password:="####"
End Sub
Private Sub TOC()
' Macro updates the Table of Contents
Application.ScreenUpdating = False
Call pass_unlock
activedocument.TablesOfContents(1).Update
Call pass_lock
Application.ScreenUpdating = True
End Sub
Private Sub autoclose()
' Runs the Table of Contents update macro before the document is closed
Call TOC
End Sub
Private Sub spell_check_Click()
'starts the form spell check
SP_Check = MsgBox("Would you like to start running Spell Check?", vbYesNo, "Spell Check")
If SP_Check = vbYes Then
MsgBox "Spell Check will begin shortly. Your Screen may flash as it runs. This is normal.", , "Spell Check"
Application.ScreenUpdating = False
Call pass_unlock
Dim iCnt As Integer
For iCnt = 1 To activedocument.FormFields.Count
'Select formfield
activedocument.FormFields(iCnt).Select
#If VBA6 Then
'Only Word > 2000
Selection.NoProofing = False
#End If
'Set Language
Selection.LanguageID = wdEnglishUS
'Run spell checker
Selection.Range.CheckSpelling
Next
Call pass_lock
Application.ScreenUpdating = True
Else
End If
MsgBox "Spell Check has finished", , "Spell Check Finished"
End Sub
Private Sub dev_add_3PL_Click()
If dev_add_3PL = True Then
activedocument.Bookmarks("three_PL_location").Range.Font.Hidden = False
Else
activedocument.Bookmarks("three_PL_location").Range.Font.Hidden = True
End If
End Sub
Private Sub dev_add_P1_Click()
Call dev_add_3PL_Click
End Sub
Private Sub dev_add_P2_Click()
Call dev_add_3PL_Click
End Sub
Private Sub dev_add_P3_Click()
Call dev_add_3PL_Click
End Sub
Private Sub document_open()
Call TOC
End Sub
Private Sub Other_Add_Click()
Call dev_add_3PL_Click
End Sub
Private Sub stackable()
End Sub
Private Sub lifting()
If remove_vacuum Or remove_crane = True Then
activedocument.Bookmarks("lifting_plan").Range.Font.Hidden = False
Else
activedocument.Bookmarks("lifting_plan").Range.Font.Hidden = True
End If
End Sub
Private Sub remove_crane_Click()
Call lifting
End Sub
Private Sub remove_manual_Click()
Call lifting
End Sub
Private Sub remove_other_Click()
Call lifting
End Sub
Private Sub remove_vacuum_Click()
Call lifting
End Sub
Private Sub return_add()
If pack_type_return Or pack_type_both = True Then
activedocument.Bookmarks("return_address").Range.Font.Hidden = False
return_resp_sup.Enabled = True
return_resp_alstom.Enabled = True
return_resp_na.Enabled = False
return_resp_na.Value = False
Else
activedocument.Bookmarks("return_address").Range.Font.Hidden = True
return_resp_sup.Enabled = False
return_resp_alstom.Enabled = False
return_resp_na.Enabled = True
return_resp_sup.Value = False
return_resp_alstom.Value = False
return_resp_na.Value = True
End If
End Sub
Private Sub comp_resp_alstom_Click()
Call return_add
End Sub
Private Sub pack_type_both_Click()
Call return_add
End Sub
Private Sub pack_type_return_Click()
Call return_add
End Sub
Private Sub HU_required_Click()
If HU_required = False Then
pu_crate.Locked = True
pu_crate.Value = False
pu_box.Locked = True
pu_box.Value = False
pu_tote.Locked = True
pu_tote.Value = False
pu_crate.Locked = True
pu_crate.Value = False
pu_tray.Locked = True
pu_tray.Value = False
pu_bag.Locked = True
pu_bag.Value = False
pu_other.Locked = True
pu_other.Value = False
pumat_wood.Locked = True
pumat_wood.Value = False
pumat_plastic.Locked = True
pumat_plastic.Value = False
pumat_metal.Locked = True
pumat_metal.Value = False
pumat_foam.Locked = True
pumat_foam.Value = False
pumat_other.Locked = True
pumat_other.Value = False
activedocument.Bookmarks("PU_Pack").Range.Font.Hidden = True
Else
pu_crate.Locked = False
pu_box.Locked = False
pu_tote.Locked = False
pu_tray.Locked = False
pu_bag.Locked = False
pu_other.Locked = False
pumat_wood.Locked = False
pumat_plastic.Locked = False
pumat_metal.Locked = False
pumat_foam.Locked = False
pumat_other.Locked = False
activedocument.Bookmarks("PU_Pack").Range.Font.Hidden = False
End If
Call TOC
End Sub
Private Sub stackable_selection()
If no_stack = True Then
stack_2 = False
stack_2.Enabled = False
stack_3 = False
stack_3.Enabled = False
stack_other = False
stack_other.Enabled = False
Else
stack_2.Enabled = True
stack_3.Enabled = True
stack_other.Enabled = True
End If
End Sub
Private Sub no_stack_Click()
Call stackable_selection
End Sub
Private Sub stack_click()
Call stackable_selection
End Sub
Private Sub cardboard()
'Selects or de-selects cardboard as the HU or HU material
If hu_cardboard Or hu_cardboard1 = True Then
hu_cardboard = True
hu_cardboard1 = True
End If
End Sub
Private Sub hu_cardboard1_Click()
If hu_cardboard1 = False Then
hu_cardboard1 = False
hu_cardboard = False
Else
Call cardboard
End If
End Sub
Private Sub hu_cardboard_Click()
If hu_cardboard = False Then
hu_cardboard1 = False
Else
Call cardboard
End If
End Sub
Private Sub cost()
'Shows / hides the bookmarks for the DAP, FCA, or SAW costs
If dap = True Then
activedocument.Bookmarks("DAP_Cost").Range.Font.Hidden = False
activedocument.Bookmarks("FCA_Cost").Range.Font.Hidden = True
activedocument.Bookmarks("SAW_Cost").Range.Font.Hidden = True
Else
If FCA = True Then
activedocument.Bookmarks("DAP_Cost").Range.Font.Hidden = True
activedocument.Bookmarks("FCA_Cost").Range.Font.Hidden = False
activedocument.Bookmarks("SAW_Cost").Range.Font.Hidden = True
Else
If saw_inc = True Then
activedocument.Bookmarks("DAP_Cost").Range.Font.Hidden = True
activedocument.Bookmarks("FCA_Cost").Range.Font.Hidden = True
activedocument.Bookmarks("SAW_Cost").Range.Font.Hidden = False
End If
End If
End If
End Sub
Private Sub dap_Click()
Call cost
End Sub
Private Sub fca_click()
Call cost
End Sub
Private Sub saw_inc_Click()
Call cost
End Sub
Private Sub reset_cost()
'Shows the bookmarks for the DAP, FCA, or SAW costs. Resets radio buttons for cost
dap = False
FCA = False
saw_inc = False
activedocument.Bookmarks("DAP_Cost").Range.Font.Hidden = False
activedocument.Bookmarks("FCA_Cost").Range.Font.Hidden = False
activedocument.Bookmarks("SAW_Cost").Range.Font.Hidden = False
End Sub
Private Sub ISPM15_Click()
If ISPM15 = True Then
activedocument.Bookmarks("TCT").Range.Font.Hidden = False
Else
activedocument.Bookmarks("TCT").Range.Font.Hidden = True
End If
Call TOC
End Sub
Private Sub ref_doc_Click()
'Focuses on the Reference Document unlocked section 7 - Reference Documents - Attachment (if section number changes, update Count:= # to reflect the change.
Selection.GoTo What:=wdGoToSection, Which:=wdGoToFirst, Count:=7, Name:=""
'add reference docunment into reference document section
Selection.InlineShapes.AddOLEObject ClassType:="Package", FileName:= _
"", LinkToFile:=False, _
DisplayAsIcon:=False
Call TOC
End Sub
Private Sub TCT_Ref_Click()
If TCT_Ref = True Then
activedocument.Bookmarks("TCT").Range.Font.Hidden = False
Else
activedocument.Bookmarks("TCT").Range.Font.Hidden = True
End If
Call TOC
End Sub