diff options
author | Behrend Cornelius <bc@openoffice.org> | 2002-09-10 07:52:01 +0000 |
---|---|---|
committer | Behrend Cornelius <bc@openoffice.org> | 2002-09-10 07:52:01 +0000 |
commit | dd2369ca2d0acb028f541ecb581909f995f2542d (patch) | |
tree | 5a80cc48c8cb9f8cd215bf29df911cc8cc44be5b /wizards/source/template | |
parent | 9374b25df28833eca19e49699c4c4a21940c8ab6 (diff) |
#96775# Errorhandler in Autotext macro inserted
Diffstat (limited to 'wizards/source/template')
-rw-r--r-- | wizards/source/template/Autotext.xba | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/wizards/source/template/Autotext.xba b/wizards/source/template/Autotext.xba index 6bc34f98e197..27a7bca1290e 100644 --- a/wizards/source/template/Autotext.xba +++ b/wizards/source/template/Autotext.xba @@ -5,6 +5,9 @@ Public UserfieldDataType(14) as String Public oDocAuto as Object Public BulletList(7) as Integer +Public sTextFieldNotDefined as String +Public sGeneralError as String + Sub Main() Dim oCursor as Object @@ -18,9 +21,13 @@ Sub Main() Dim FieldStringThere as String Dim ULStringThere as String Dim PHStringThere as String - + On Local Error Goto GENERALERROR ' Initialization... BasicLibraries.LoadLibrary("Tools") + If InitResources("'Template'", "tpl") Then + sGeneralError = GetResText(1302) + sTextFieldNotDefined = GetResText(1400) + End If UserfieldDatatype(0) = "COMPANY" UserfieldDatatype(1) = "FIRSTNAME" @@ -79,6 +86,13 @@ Sub Main() CreatePlaceholder(oCursor, sFoundContent) End If Next i + + GENERALERROR: + If Err <> 0 Then + Msgbox(sGeneralError,16, GetProductName()) + Resume LETSGO + End If + LETSGO: End Sub @@ -86,7 +100,6 @@ End Sub ' "<field:Company>" Sub CreateUserDatafield(oCursor, sFoundContent as String) Dim MaxIndex as Integer - Dim sTextFieldNotDefined as String Dim sFoundList(3) Dim oUserfield as Object Dim UserInfo as String @@ -101,10 +114,7 @@ Sub CreateUserDatafield(oCursor, sFoundContent as String) oCursor.Text.InsertTextContent(oCursor,oUserField,True) oUserField.IsFixed = True Else - If InitResources("'Template'", "tpl") Then - sTextFieldNotDefined = GetResText(1400) - Msgbox(UserInfo &": " & sTextFieldNotDefined,16, GetProductName()) - End If + Msgbox(UserInfo &": " & sTextFieldNotDefined,16, GetProductName()) End If End Sub |