Discussion:
Insert symbol into cell in table
(too old to reply)
Mark
2006-02-23 11:16:29 UTC
Permalink
i am trying to insert a symbol in a cell with the following code:

ActiveDocument.Tables(3).Rows(Tables(3).Rows.Count).Cells(2).Select
Selection.InsertSymbol Font:="Wingdings", CharacterNumber:=-3844, Unicode _
:=True

but it throws up an error -

Run time error 4605
The method or property is not available because the object does not refer to
a simple range or selection.

This routine is called from a cmdbutton on the document.
Can someone please point me in the right direction?

Many thanks
--
Mark
Helmut Weber
2006-02-23 12:26:29 UTC
Permalink
Hi Mark,

like this:

ActiveDocument.Tables(1).Range.Cells(2).Select
Selection.MoveEnd Unit:=wdCharacter, Count:=-1
Selection.InsertSymbol Font:="Wingdings", _
CharacterNumber:=-3844, Unicode:=True
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
"red.sys" & chr(64) & "t-online.de"
Mark
2006-02-23 12:36:25 UTC
Permalink
Hi Helmet,

Thanks, the table expands with additional rows of data and I need to be able
to put the ticks in the lastrow each time, can you help?
--
Mark
Post by Helmut Weber
Hi Mark,
ActiveDocument.Tables(1).Range.Cells(2).Select
Selection.MoveEnd Unit:=wdCharacter, Count:=-1
Selection.InsertSymbol Font:="Wingdings", _
CharacterNumber:=-3844, Unicode:=True
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
"red.sys" & chr(64) & "t-online.de"
Mark
2006-02-23 12:38:27 UTC
Permalink
Helmet,

i've sorted it, thanks for your help
--
Mark
Post by Helmut Weber
Hi Mark,
ActiveDocument.Tables(1).Range.Cells(2).Select
Selection.MoveEnd Unit:=wdCharacter, Count:=-1
Selection.InsertSymbol Font:="Wingdings", _
CharacterNumber:=-3844, Unicode:=True
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
"red.sys" & chr(64) & "t-online.de"
Helmut Weber
2006-02-23 12:43:27 UTC
Permalink
... just in case you found:

ActiveDocument.Tables(3).Rows(ActiveDocument.Tables(3).Rows.Count).Cells(2).Select

there is also:

ActiveDocument.Tables(3).Rows.Last.Cells(2).Select
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
"red.sys" & chr(64) & "t-online.de"
Loading...