Getting 5992 error after moving macro code to MS word 2007 from MS Word 2003


below code working fine in older version. after moving ms word 2007, throwing error 5992.

at ..

  .columns(i).width = sprachenbreite

code below

public sub setlanguages(anzahl byte)
    dim integer
    ', sprachenbreite single, wertbreite single, kategoriebreite single, seitenbreite single

    protokolliere ("setlanguages(" & anzahl & ")")

    ' formatierungszeichen in word ausblenden
    if activewindow.activepane.view.showall = true then
      activewindow.activepane.view.showall = not activewindow.activepane.view.showall
    end if

    languages = anzahl
    seitenbreite = activedocument.pagesetup.pagewidth - activedocument.pagesetup.leftmargin - activedocument.pagesetup.rightmargin
    kategoriebreite = seitenbreite / 11.7
    wertbreite = seitenbreite / 5
    if anzahl = 0 then
        sprachenbreite = 0
    else
        sprachenbreite = ((seitenbreite - kategoriebreite - wertbreite) / anzahl)
    end if

    'msgbox ("sprachenbreite: " & sprachenbreite)

    ' lp 01.04.2011:
    ' rechtschreibprüfung ausschalten
    options.checkspellingasyoutype = false
    'activedocument.range.noproofing = true
    'application.checklanguage = false

    ' lp 25.11.2009:
    selection.languageid = wdjapanese
    selection.noproofing = false
    application.checklanguage = true

    seitenumbruch = 0
    sleeptime = 0 ' in millisekunden
end sub

public sub insert_table(zeilen integer, spalten integer)
    dim integer

    protokolliere ("call insert_table(" & zeilen & ", " & spalten & ")")

    activedocument.tables.add selection.range, zeilen, spalten, wdword9tablebehavior, wdautofitfixed

    selection.tables(1)
      ' lp 01.04.2011
          'on error goto errhandler:
        = 1 languages
            .columns(i).width = sprachenbreite
        next i
        .columns(languages + 1).width = wertbreite
        .columns(languages + 2).width = kategoriebreite
'errhandler:
            ' error handling code
        .select

        selection.font.name = "arial"
        'neu:
        selection.paragraphformat.rightindent = 0
        selection.moveleft
    end with
end sub

                                                

hi,

this forum discuss questions , feedback for microsoft office client. since query directly related macros, suggest post in dedicated forum of word developers, can more experienced responses:

https://social.msdn.microsoft.com/forums/office/en-us/home?forum=worddev

the reason why recommend posting appropriately qualified pool of respondents, , other partners read forums regularly can either share knowledge or learn interaction us. thank understanding.

regards,

ethan hua
technet community support


it's recommended download , install configuration analyzer tool (offcat), developed microsoft support teams. once tool installed, can run @ time scan hundreds of known issues in office programs.



Microsoft Office  >  Word IT Pro Discussions



Comments

Popular posts from this blog

WIMMount (HSM) causing cluster storage to go redirected (2012r2 DC)

Failed to delete the test record dcdiag-test-record in zone test.com

Azure MFA with Azure AD and RDS