
Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Yes, I know most of that (not sure what Organizer is though).
>
[quoted text clipped - 29 lines]
>> >
>> > Thanks
I have discovered a slight problem with this macro - this is the code, it is
meant to cut one selected table out whilst putting another in by means of an
assigned toolbar button.
Sub pastetable()
If Selection.Information(wdWithInTable) Then
Selection.Cut
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=2,
NumColumns:= _
5, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
wdAutoFitFixed
With Selection.Tables(1)
If .Style <> "Table Grid" Then
.Style = "Table Grid"
End If
.ApplyStyleHeadingRows = True
.ApplyStyleLastRow = True
.ApplyStyleFirstColumn = True
.ApplyStyleLastColumn = True
End With
Selection.TypeText Text:="this"
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:="is"
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:="the"
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:="example"
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:="This"
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=4
Selection.TypeText Text:="is"
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:="example"
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:="of"
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:="macro"
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:="working"
Else
MsgBox "Please select a table."
End If
This is the error I am getting,
"The method or property is not available because the object is empty".
Now, if the cursor happens to be before or after the table, and the macro
button is pressed then the message box appears fine. But, if the cursor
happens to be in a table cell, and the macro button is pressed, then I get
the error message above. Any ideas how I can fix it.
Thanks
End Sub
> See the article "Distributing macros to other users" at:
>
[quoted text clipped - 33 lines]
> >> >
> >> > Thanks
Russ - 23 Nov 2007 23:57 GMT
Question re-posted in another message thread.
<http://groups.google.com/group/microsoft.public.word.vba.beginners/browse_t
hread/thread/ab5b1e2b19d19d9a/62fb1b7ce765c3ab>
> I have discovered a slight problem with this macro - this is the code, it is
> meant to cut one selected table out whilst putting another in by means of an
[quoted text clipped - 94 lines]
>>>>>
>>>>> Thanks

Signature
Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID