summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
Diffstat (limited to 'wizards')
-rw-r--r--wizards/source/template/Correspondence.xba29
1 files changed, 21 insertions, 8 deletions
diff --git a/wizards/source/template/Correspondence.xba b/wizards/source/template/Correspondence.xba
index 9c8a6eeca564..4ecb5aa45670 100644
--- a/wizards/source/template/Correspondence.xba
+++ b/wizards/source/template/Correspondence.xba
@@ -59,17 +59,24 @@ Dim sDBField as String
Dim i as Integer
Dim oDBAccess as Object
Dim oAddressDialog as Object
+Dim oAddressPilot as Object
Dim oFields as Object
Dim oDocSettings as Object
- bDBFields = DialogModel.Optmerge.State 'db oder PLatzhalter
+ bDBFields = DialogModel.Optmerge.State 'database or placeholder
If bDBFields Then
oDBAccess = GetRegistryKeyContent("org.openoffice.Office.DataAccess/AddressBook/")
sAddressbook = oDBAccess.DataSourceName
- If sAddressbook = "" Then
- oAddressDialog = CreateUnoService("com.sun.star.ui.AddressBookSourceDialog")
- oAddressDialog.Execute
+
+ If sAddressbook = "" Then 'If there is no field mapping
+ If Not odBAccess.AutoPilotCompleted Then 'If the Mapping Pilot never ran
+ oAddressPilot = createUnoService("com.sun.star.ui.dialogs.AddressBookSourcePilot")
+ oAddressPilot.execute
+ Else
+ oAddressDialog = CreateUnoService("com.sun.star.ui.AddressBookSourceDialog")
+ oAddressDialog.execute
+ End If
oDBAccess = GetRegistryKeyContent("org.openoffice.Office.DataAccess/AddressBook/")
sAddressbook = oDBAccess.DataSourceName
If sAddressbook = "" Then
@@ -116,6 +123,8 @@ Dim oDocSettings as Object
sDBField = GetFieldname(oFields, sFoundContent)
If sDBField <> "" Then
InsertDBField(sAddressbook, Table, sDBField)
+ Else
+ InsertPlaceholder(sFoundContent)
End If
Else
InsertPlaceholder(sFoundContent)
@@ -161,7 +170,9 @@ End Sub
Sub InsertPlaceholder(sColName as String)
Dim oFieldMaster as Object
+Dim bCorrectField as Boolean
If sColname <> "" Then
+ bCorrectField = True
oFieldMaster = oDocument.createInstance("com.sun.star.text.TextField.JumpEdit")
Select Case sColName
Case "Company"
@@ -227,10 +238,12 @@ Dim oFieldMaster as Object
Case "InviteParticipant"
oFieldMaster.PlaceHolder = getResText(1350+31)
Case Else
- oFieldMaster.PlaceHolder = sColName
+ bCorrectField = False
End Select
- oFieldMaster.Hint = getResText(1350)
- oBookText.InsertTextContent(oBookMarkCursor, oFieldMaster, True)
+ If bCorrectField Then
+ oFieldMaster.Hint = getResText(1350)
+ oBookText.InsertTextContent(oBookMarkCursor, oFieldMaster, True)
+ End If
End If
End Sub
-</script:module>
+</script:module> \ No newline at end of file