O
Owen
Hello
I am attempting to use a macro to insert a combobox within a table in my
document. I am getting an error at,
cboNew = Document.Controls.Add("Document.Combobox.1", "cboNew")
which responds with "object required".
I am new to programming and can't work out the error. I have attached my
full code below.
Sub Macro4()
ActiveDocument.Unprotect
Selection.GoTo What:=wdGoToBookmark, Name:="Equipment_Software"
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=5, Extend:=wdExtend
Selection.Copy
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCell
Selection.Paste
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Set cboNew = Document.Controls.Add("Document.Combobox.1", "cboNew")
With cboNew
..AddItem " "
..AddItem "AP Long Range Wireless LAN"
..FontName = "Arial"
..FontSize = "8"
..Width = 250
End With
End Sub
Can anyone tell me where i am going wrong?
Thanks Owen
I am attempting to use a macro to insert a combobox within a table in my
document. I am getting an error at,
cboNew = Document.Controls.Add("Document.Combobox.1", "cboNew")
which responds with "object required".
I am new to programming and can't work out the error. I have attached my
full code below.
Sub Macro4()
ActiveDocument.Unprotect
Selection.GoTo What:=wdGoToBookmark, Name:="Equipment_Software"
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=5, Extend:=wdExtend
Selection.Copy
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCell
Selection.Paste
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Set cboNew = Document.Controls.Add("Document.Combobox.1", "cboNew")
With cboNew
..AddItem " "
..AddItem "AP Long Range Wireless LAN"
..FontName = "Arial"
..FontSize = "8"
..Width = 250
End With
End Sub
Can anyone tell me where i am going wrong?
Thanks Owen