Table question

L

LEU

I have a macro that creates a warning table with two columns. What I would
like it to do is in the first column is load the hazard and the second column
would list the controls for that hazard. There could be more than one hazard
in the table.

The following is an example:

Column One is the Hazard
Column Two is the Controls


Column One Row One
Chemical Exposure Hazard

Column Two Row One
Avoid contact with eyes.
Avoid breathing vapor or mist.
Wash hands thoroughly after use.
Review MSDS for each chemical
Locate pressurized portable eye wash station near work area.
Use nitrile gloves when applying chemicals.


Column One Row Two
Electrical Hazards

Column Two Row Two
Inspect tools/equipment for damage prior to use. Do not use damaged tools
or equipment
Use ground fault circuit interrupters (GFCI).

How would I create bookmarks for each Row and then open a form that listed
the hazards and the appropriate controls. Then the user could pick the ones
they needed and it would load them into the table?

I hope I explained this ok.
 
L

LEU

This is what I have so far.


Sub WarningBox()
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=3, NumColumns:= _
1, DefaultTableBehavior:=wdWord9TableBehavior,
AutoFitBehavior:=wdAutoFitFixed
Selection.Tables(1).Rows.SetLeftIndent LeftIndent:=44,
RulerStyle:=wdAdjustNone
Selection.Tables(1).Columns(1).SetWidth ColumnWidth:=423,
RulerStyle:=wdAdjustNone
Selection.Tables(1).Borders.OutsideLineWidth = wdLineWidth150pt
Selection.ParagraphFormat.Style = "Normal"
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Selection.Font.Size = 18
Selection.Font.Color = wdColorRed
Selection.Font.Bold = wdToggle
Selection.Font.Underline = wdUnderlineSingle
Selection.TypeText Text:="Warning"
Selection.Font.Underline = wdUnderlineNone
Selection.Font.Bold = wdToggle
Selection.TypeParagraph
Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
Selection.TypeBackspace
With Selection.ParagraphFormat
.LeftIndent = InchesToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 6
.SpaceAfterAuto = False
End With
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.Cells.Split NumRows:=1, NumColumns:=2, MergeBeforeSplit:=False
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Selection.MoveRight Unit:=wdCell
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Selection.Font.Bold = wdToggle
Selection.TypeText Text:="POTENTIAL HAZARDS"
Selection.MoveRight Unit:=wdCell
Selection.Font.Bold = wdToggle
Selection.TypeText Text:="CONTROLS"
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.Cells.Split NumRows:=1, NumColumns:=2, MergeBeforeSplit:=False
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=1

End Sub
 
L

LEU

Doug,

Thanks for the help.

I looked at Greg's page but I'm still stuck. I worked on it last night and
this morning but can't get it to work. I can draw my table, load my form but
can't get it from the form back to the table.

Larry
 

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