O
Owen
I am using Microsoft Word 2003. I have a protected document which contains
the following code:
Sub AddHardware()
ActiveDocument.Unprotect Password:="ngo999"
Dim oRng As Word.Range
Set oRng = ActiveDocument.Tables(15).Rows.Last.Range
oRng.MoveEnd wdCharacter, -2
oRng.Select
Selection.Copy
Selection.InsertRowsBelow 1
Selection.Paste
PopulateHardwareCB
End Sub
Sub PopulateHardwareCB()
Dim oTbl As Word.Table
Dim oCtrMaster As Object
Dim oCtrSlave As Object
Set oTbl = ActiveDocument.Tables(15)
Set oCtrMaster = oTbl.Cell(3, 1).Range.InlineShapes(1).OLEFormat.Object
Set oCtrSlave = oTbl.Cell(oTbl.Rows.Count,
1).Range.InlineShapes(1).OLEFormat.Object
oCtrSlave.List = oCtrMaster.List
ActiveDocument.Protect (wdAllowOnlyFormFields), Password:="ngo999",
NoReset:=True
End Sub
The original document contains a Combo Box in the first row of a table. The
macro copies the Combo Box and its list items and pastes them to a new row
created below the previous row in the table.
When the Combo Boxes are created, the selected items successfully print.
However, if the document is closed and re-opened, the selected item still
appears but will not print.
I have tried printing to printer and to Adiobe PDF but the Combo box appears
blank even though it is populated within Word.
Does anyone have any ideas?
the following code:
Sub AddHardware()
ActiveDocument.Unprotect Password:="ngo999"
Dim oRng As Word.Range
Set oRng = ActiveDocument.Tables(15).Rows.Last.Range
oRng.MoveEnd wdCharacter, -2
oRng.Select
Selection.Copy
Selection.InsertRowsBelow 1
Selection.Paste
PopulateHardwareCB
End Sub
Sub PopulateHardwareCB()
Dim oTbl As Word.Table
Dim oCtrMaster As Object
Dim oCtrSlave As Object
Set oTbl = ActiveDocument.Tables(15)
Set oCtrMaster = oTbl.Cell(3, 1).Range.InlineShapes(1).OLEFormat.Object
Set oCtrSlave = oTbl.Cell(oTbl.Rows.Count,
1).Range.InlineShapes(1).OLEFormat.Object
oCtrSlave.List = oCtrMaster.List
ActiveDocument.Protect (wdAllowOnlyFormFields), Password:="ngo999",
NoReset:=True
End Sub
The original document contains a Combo Box in the first row of a table. The
macro copies the Combo Box and its list items and pastes them to a new row
created below the previous row in the table.
When the Combo Boxes are created, the selected items successfully print.
However, if the document is closed and re-opened, the selected item still
appears but will not print.
I have tried printing to printer and to Adiobe PDF but the Combo box appears
blank even though it is populated within Word.
Does anyone have any ideas?