diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterFormWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterFormWindowState.xcu
index e273ec0cdbdf..62546760b8c5 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterFormWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterFormWindowState.xcu
@@ -123,6 +123,26 @@
true
+
+
+ 0,2
+
+
+ true
+
+
+ 0
+
+
+ Mail Merge
+
+
+ true
+
+
+ true
+
+
false
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterReportWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterReportWindowState.xcu
index 8d7cae8eadf2..4cc23c366173 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterReportWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterReportWindowState.xcu
@@ -123,6 +123,26 @@
true
+
+
+ 0,2
+
+
+ true
+
+
+ 0
+
+
+ Mail Merge
+
+
+ true
+
+
+ true
+
+
false
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
index 5cdb74bb276b..f1e4972b00b1 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
@@ -143,6 +143,26 @@
true
+
+
+ 0,2
+
+
+ true
+
+
+ 0
+
+
+ Mail Merge
+
+
+ true
+
+
+ true
+
+
false
diff --git a/sw/UIConfig_swform.mk b/sw/UIConfig_swform.mk
index c11d85ae45f9..4ca2f95fc2f7 100644
--- a/sw/UIConfig_swform.mk
+++ b/sw/UIConfig_swform.mk
@@ -59,6 +59,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/swform,\
sw/uiconfig/swform/toolbar/graphicobjectbar \
sw/uiconfig/swform/toolbar/insertbar \
sw/uiconfig/swform/toolbar/insertobjectbar \
+ sw/uiconfig/swform/toolbar/mailmerge \
sw/uiconfig/swform/toolbar/mediaobjectbar \
sw/uiconfig/swform/toolbar/moreformcontrols \
sw/uiconfig/swform/toolbar/numobjectbar \
diff --git a/sw/UIConfig_swreport.mk b/sw/UIConfig_swreport.mk
index 061dd92655a8..fe9789e3ea51 100644
--- a/sw/UIConfig_swreport.mk
+++ b/sw/UIConfig_swreport.mk
@@ -59,6 +59,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/swreport,\
sw/uiconfig/swreport/toolbar/graphicobjectbar \
sw/uiconfig/swreport/toolbar/insertbar \
sw/uiconfig/swreport/toolbar/insertobjectbar \
+ sw/uiconfig/swreport/toolbar/mailmerge \
sw/uiconfig/swreport/toolbar/mediaobjectbar \
sw/uiconfig/swreport/toolbar/moreformcontrols \
sw/uiconfig/swreport/toolbar/numobjectbar \
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index c85d90dce099..46a1db2f815f 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -62,6 +62,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/swriter,\
sw/uiconfig/swriter/toolbar/graphicobjectbar \
sw/uiconfig/swriter/toolbar/insertbar \
sw/uiconfig/swriter/toolbar/linesbar \
+ sw/uiconfig/swriter/toolbar/mailmerge \
sw/uiconfig/swriter/toolbar/mediaobjectbar \
sw/uiconfig/swriter/toolbar/moreformcontrols \
sw/uiconfig/swriter/toolbar/navigationobjectbar \
diff --git a/sw/UIConfig_swxform.mk b/sw/UIConfig_swxform.mk
index 67a061a364da..59bc4f25fc29 100644
--- a/sw/UIConfig_swxform.mk
+++ b/sw/UIConfig_swxform.mk
@@ -60,6 +60,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/swxform,\
sw/uiconfig/swxform/toolbar/graphicobjectbar \
sw/uiconfig/swxform/toolbar/insertbar \
sw/uiconfig/swxform/toolbar/insertobjectbar \
+ sw/uiconfig/swxform/toolbar/mailmerge \
sw/uiconfig/swxform/toolbar/mediaobjectbar \
sw/uiconfig/swxform/toolbar/moreformcontrols \
sw/uiconfig/swxform/toolbar/numobjectbar \
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index ab8ba8cd8d00..daa58c198931 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -87,6 +87,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -672,11 +673,36 @@ void SwModule::ExecOther(SfxRequest& rReq)
#if HAVE_FEATURE_DBCONNECTIVITY
case FN_MAILMERGE_WIZARD:
{
+ // show the mailmerge wizard
rtl::Reference< SwMailMergeWizardExecutor > xEx( new SwMailMergeWizardExecutor );
xEx->ExecuteMailMergeWizard( pArgs );
+
+ // show the mailmerge toolbar
+ SwView* pView = ::GetActiveView();
+ if (!pView)
+ return;
+
+ uno::Reference xPropSet(pView->GetViewFrame()->GetFrame().GetFrameInterface(), uno::UNO_QUERY);
+ if (!xPropSet.is())
+ return;
+
+ uno::Reference xLayoutManager;
+ uno::Any aValue = xPropSet->getPropertyValue("LayoutManager");
+ aValue >>= xLayoutManager;
+ if (!xLayoutManager.is())
+ return;
+
+ const OUString sResourceURL( "private:resource/toolbar/mailmerge" );
+ uno::Reference xUIElement = xLayoutManager->getElement(sResourceURL);
+ if (!xUIElement.is())
+ {
+ // do the work, finally
+ xLayoutManager->createElement(sResourceURL);
+ xLayoutManager->showElement(sResourceURL);
+ }
}
-#endif
break;
+#endif
}
}
diff --git a/sw/uiconfig/swform/toolbar/mailmerge.xml b/sw/uiconfig/swform/toolbar/mailmerge.xml
new file mode 100644
index 000000000000..f80aeb421d66
--- /dev/null
+++ b/sw/uiconfig/swform/toolbar/mailmerge.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
diff --git a/sw/uiconfig/swreport/toolbar/mailmerge.xml b/sw/uiconfig/swreport/toolbar/mailmerge.xml
new file mode 100644
index 000000000000..f80aeb421d66
--- /dev/null
+++ b/sw/uiconfig/swreport/toolbar/mailmerge.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
diff --git a/sw/uiconfig/swriter/toolbar/mailmerge.xml b/sw/uiconfig/swriter/toolbar/mailmerge.xml
new file mode 100644
index 000000000000..f80aeb421d66
--- /dev/null
+++ b/sw/uiconfig/swriter/toolbar/mailmerge.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
diff --git a/sw/uiconfig/swxform/toolbar/mailmerge.xml b/sw/uiconfig/swxform/toolbar/mailmerge.xml
new file mode 100644
index 000000000000..f80aeb421d66
--- /dev/null
+++ b/sw/uiconfig/swxform/toolbar/mailmerge.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+