Cannot access individual columns ... error

From: Joe (anonymous_at_discussions.microsoft.com)
Date: 03/11/04


Date: Thu, 11 Mar 2004 08:16:22 -0800

I am getting the following error when I run my code from a DLL that creates a Word document.. Does anyone know what this means?

Cannot access individual columns in this collection because the table has mixed cell widths. (Error #5992).

The code is below and the error line is highlighted with '***********'

Thanks,

Joe

Code:

With wd
        With .Selection
            .Font.Bold = True
            .Font.Size = 16
            .Font.Color = wdColorWhite
            .Font.Shading.BackgroundPatternColor = wdColorGreen
            .TypeText vbTab & "NETWORK" & vbTab
            .Font.Shading.BackgroundPatternColor = wdColorWhite
            .TypeParagraph
            .TypeParagraph
            
            If wbk.Worksheets("Network").Range("VPN") <> "<Select>" Then

                .Font.Bold = True
                .Font.Size = 12
                .Font.Color = wdColorBlack
                .TypeText "Remote Access:"
                .TypeParagraph
                .TypeParagraph
                
                ' -- Connection Summary --
                .Font.Bold = True
                .Font.Size = 10
                .TypeText "Connection:"
                .Font.Bold = False
                .TypeParagraph
                
                .TypeText vbTab & vbTab & "VPN: "
                .TypeText wbk.Worksheets("Network").Range("VPN")
                .TypeParagraph
                
                .TypeText vbTab & vbTab & "VPN client vendor: "
                .TypeText wbk.Worksheets("Network").Range("VPNcvendor")
                .TypeParagraph
                
                .TypeText vbTab & vbTab & "VPN client version: "
                .TypeText wbk.Worksheets("Network").Range("VPNcversion")
                .TypeParagraph
                .TypeParagraph
                
                .TypeText vbTab & vbTab & "Dial access: "
                .TypeText wbk.Worksheets("Network").Range("Dial")
                .TypeParagraph
                
                .TypeText vbTab & vbTab & vbTab & "Modem Selection: "
                .TypeText wbk.Worksheets("Network").Range("CTXModem")
                .TypeParagraph
                
                .TypeText vbTab & vbTab & vbTab & "Backup to Primary remote access: "
                .TypeText wbk.Worksheets("Network").Range("VPNbackup")
                .TypeParagraph
                
                .TypeText vbTab & vbTab & "Comments: "
                .TypeText wbk.Worksheets("Network").Range("RemoteComment")
                .TypeParagraph
                .TypeParagraph
                
                ' -- Security Summary --
                .Font.Bold = True
                .TypeText "Security:"
                .Font.Bold = False
                .TypeParagraph
                
                .TypeText vbTab & "Password Requirements: "
                .TypeText wbk.Worksheets("Network").Range("PwdReqs")
                .TypeParagraph
                
                .TypeText vbTab & "Individual Access Agreement Required: "
                .TypeText wbk.Worksheets("Network").Range("IndAccess")
                .TypeParagraph
                
                .TypeText vbTab & "Background Check Required: "
                .TypeText wbk.Worksheets("Network").Range("BackCheck")
                .TypeParagraph
                .TypeParagraph
                
                ' -- Technical Contact Summary --
                .Font.Bold = True
                .TypeText "Technical Contact Information:"
                .Font.Bold = False
                .TypeParagraph
                
                .TypeText vbTab & "Contact Name: "
                .TypeText wbk.Worksheets("Network").Range("TechName")
                .TypeParagraph
                
                .TypeText vbTab & "Contact Phone: "
                .TypeText wbk.Worksheets("Network").Range("TechPhone")
                .TypeParagraph
                
                .TypeText vbTab & "Contact Email: "
                .TypeText wbk.Worksheets("Network").Range("TechEmail")
                .TypeParagraph
                .TypeParagraph
                
                ' -- Tools table --
                .Tables.Add Range:=.Range, NumRows:=7, NumColumns:=3
                iLastTable = .Tables.Count

 ********************** Error appears here *****************

                .Tables(iLastTable).Columns(1).SetWidth wd.InchesToPoints(2.5), wdAdjustNone
                .Tables(iLastTable).Columns(2).SetWidth wd.InchesToPoints(2), wdAdjustNone
                .Tables(iLastTable).Columns(3).SetWidth wd.InchesToPoints(2), wdAdjustNone

                .Tables(iLastTable).Cell(1, 1).Select
                .Range.Font.Bold = True
                .TypeText "Tool"
                .Shading.BackgroundPatternColor = wdColorGray15

                .Tables(iLastTable).Cell(1, 2).Select
                .Shading.BackgroundPatternColor = wdColorWhite
                .TypeText "Selection"

                .Tables(iLastTable).Cell(1, 3).Select
                .TypeText "Port Range"
                
                .Tables(iLastTable).Cell(2, 1).Select
                .TypeText "PcAnywhere"
                .Shading.BackgroundPatternColor = wdColorGray15

                .Tables(iLastTable).Cell(2, 2).Select
                .Shading.BackgroundPatternColor = wdColorWhite
                .TypeText wbk.Worksheets("Network").Range("Tpca")

                .Tables(iLastTable).Cell(2, 3).Select
                .TypeText "5631 (TCP), 5632 (UDP)"
                
                .Tables(iLastTable).Cell(2, 1).Select
                .TypeText "Terminal Services/RDP"
                .Shading.BackgroundPatternColor = wdColorGray15

                .Tables(iLastTable).Cell(2, 2).Select
                .Shading.BackgroundPatternColor = wdColorWhite
                .TypeText wbk.Worksheets("Network").Range("Trdp")

                .Tables(iLastTable).Cell(2, 3).Select
                .TypeText "3389"
                
                .Tables(iLastTable).Cell(2, 1).Select
                .TypeText "FTP"
                .Shading.BackgroundPatternColor = wdColorGray15

                .Tables(iLastTable).Cell(2, 2).Select
                .Shading.BackgroundPatternColor = wdColorWhite
                .TypeText wbk.Worksheets("Network").Range("Tftp")

                .Tables(iLastTable).Cell(2, 3).Select
                .TypeText "20-21"
                
                .Tables(iLastTable).Cell(2, 1).Select
                .TypeText "Telnet"
                .Shading.BackgroundPatternColor = wdColorGray15

                .Tables(iLastTable).Cell(2, 2).Select
                .Shading.BackgroundPatternColor = wdColorWhite
                .TypeText wbk.Worksheets("Network").Range("Ttelnet")

                .Tables(iLastTable).Cell(2, 3).Select
                .TypeText "23"
                
                .Tables(iLastTable).Cell(2, 1).Select
                .TypeText "SNMP"
                .Shading.BackgroundPatternColor = wdColorGray15

                .Tables(iLastTable).Cell(2, 2).Select
                .Shading.BackgroundPatternColor = wdColorWhite
                .TypeText wbk.Worksheets("Network").Range("Tsnmp")

                .Tables(iLastTable).Cell(2, 3).Select
                .TypeText "161-162(UDP)"
                
                .Tables(iLastTable).Cell(2, 1).Select
                .TypeText "SSH"
                .Shading.BackgroundPatternColor = wdColorGray15

                .Tables(iLastTable).Cell(2, 2).Select
                .Shading.BackgroundPatternColor = wdColorWhite
                .TypeText wbk.Worksheets("Network").Range("Tssh")

                .Tables(iLastTable).Cell(2, 3).Select
                .TypeText "22"
                
            End If
        End With
End With



Relevant Pages

  • Cannot access individual columns ... error
    ... I am getting the following error when I run my code from a DLL that creates a Word document.. ... Cannot access individual columns in this collection because the table has mixed cell widths. ... Joe ...
    (microsoft.public.word.vba.general)
  • Re: Word template and VSTO
    ... Property in the Word document _AssemblyLocation0. ... to the dll. ... > I created a Word template project using VB .NET. ...
    (microsoft.public.vsnet.vstools.office)
  • Add an Image object to the document ...
    ... I wants to add an image which is a part of my satellite assembly (means dll) to the excel or word document on the button click of my customized toolbar. ... I tried using AddPicture method but the first parameter is a string path of the image file and I want to use image object. ...
    (microsoft.public.vsnet.vstools.office)
  • Re: Help ASP.NET 2.0 and WORD
    ... I believe you can access word documents using the dll ... SteveM wrote: ... to save the document as HTML in Word to that folder. ... I am needing some help/advice on how to display a word document in my ...
    (microsoft.public.dotnet.framework.aspnet)
  • Printing Word document via automation
    ... When I attempt to print a Word document using automation, ... I'm "talking" to Word via a DLL written in VB6. ... step thru the DLL code using the debugger, as soon as .PrintOut method for ... debugger, nothing happens. ...
    (microsoft.public.office.developer.automation)