Skip to main content link. Accesskey S
  • Log In
  • Help
  • IBM Logo
  • Lotus Symphony wiki
  • All Wikis
  • All Forums
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • IBM Redbooks
Community Articles Product Documentation Learning Center IBM Redbooks This category Lotus Symphony 3 Documentation Custom Search Scope...
Search
Community Articles > Macros > How to create a Custom Dialog in a Symphony Document
  • New Article
  • Share Show Menu▼
  • Subscribe Show Menu▼

About the Original Author

IBM contributorPaul Bastide
Contribution Summary:
  • Articles authored: 53
  • Articles edited: 30
  • Comments Posted: 12

Recent articles by this author

Lotusphere 2011 AD204 Customizing IBM® Lotus® Symphony™ and Automating Your Enterprise Deployment

A presentation on how to customize IBM Lotus Symphony and Automate your enterprise deployment

Demo: Visual Basic for Applications

This article is a basic demonstration showing Lotus Symphony 3.0 Beta 2's support for VBA.

Packaging your Plugin for Deployment

Once a developer has created the musthave application, he or she finds it necessary to package the application and plugin so customers can install the plugin. This article shows how to take a plugin, make a feature, and then updatesite.

Lotus Symphony Programmability Workshop: Lotusphere 2010: Building a XPD Solution with Lotus Symphony

For those interested in learning how to develop a solution with Lotus Symphony, you can find attached: 1. A Presentation introducing Lotus Symphony Development 2. A Lab which introduces programming with Lotus Symphony and XPD.

Lotusphere 2010: Lotus Solutions Development Lab: Lab 05: Symphony Lab

Lotusphere 2010 has a great presence for Lotus Symphony Developers. If you were unable to make the Lotus Solutions Development Lab, please feel free to reference the attached PDF and ODT which document how to build a solution with Lotus Symphony.

Community articleHow to create a Custom Dialog in a Symphony Document

Added by Paul Bastide | Edited by IBM contributor Paul Bastide on October 22, 2009 | Version 2
  • Edit
  • More Actions Show Menu▼
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars
expanded Abstract
collapsed Abstract
No abstract provided.
Tags: Macros, Basic, Symphony, StarBasic
To create complex and interactive documents in Lotus Symphony, people find it necessary to build dialogs and macros with Lotus Symphony.

This article quickly shows how you can build your Dialog.

To build your dialog, open your document.

Click Tools then Macros then Macro

Click on Untitled then Sample
Click Organizer
Note: Untitled represents the name of your document.


Click New Dialog
Enter the name of the Dialog as MyDialog
Click Ok

Click Edit

You should see:


In the menu bar, you see a number of options.
Click on the drop down for the controls element


You should see the controls toolbar, and now you can add a button and a text box to MyDialog.


Now you should now write the supporting macro code

Right Click the Toolbar at the bottom
Click Insert, then BASIC Module


Now you can add the LaunchDialog code to the Module
This code locates the library it is stored in, and then grabs the MyDialog, and launches it.
 
Dim myDialog

Sub launchDialog
Dim oLib
Dim oLibDlg 
DialogLibraries.loadLibrary("Standard")
oLib = DialogLibraries.getByName("Standard")
oLibDlg = oLib.getByName("MyDialog")
myDialog = CreateUnoDialog(oLibDlg)
myDialog.execute()
End Sub


The next step is to complete the code behind the Command Button.
The code inserts a simple string.
 
Sub insertIntoDoc
    Dim oText 
	oText = myDialog.getControl("TextField1")
	Dim oDocText
	oDocText = ThisComponent.Text
	oViewCursor = ThisComponent.getCurrentController().getViewCursor()
            oCursor = oDocText.createTextCursorByRange(oViewCursor.getStart())
	oDocText.insertString(oCursor,oText.Text,false)
End Sub


Now, you need to link the insertIntoDoc method to the Command Button.
Click on the MyDialog tab
Right Click the CommandButton
Click Properties
Click Events
Click the ellipsis next to When Initiating


Drill down in your document, click on the insertIntoDoc macro
Click Assign
Click Ok


You can now close the Basic Editor.

With the code complete, you can add a button to execute MyDialog.
Click View, then Toolbar, then Form Functions
Add a Push Button to the Page

Note: From the toolbar, you may need to enable Design Mode


Right Click on your new Button
Click Control Properties
Click Events
Click the ellipsis next to When Initiating

Drill down in your document, click on the launchDialog macro
Click Assign
Click Ok


Disable the Design Mode
Click the Toolbar Icon


Now Run your Dialog by Clicking the Button


You now have a form enabled Document.

References:
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Basic/OpenOffice.org_Basic

Sample:
(See attached file: New Document.odt)

  • Edit
  • More Actions Show Menu▼


expanded Attachments (1)
collapsed Attachments (1)
Edit the article to add or modify attachments.
File TypeSizeFile NameCreated On
application/octet-stream 10 KB New Document.odt 10/22/09 8:32 AM
expanded Versions (2)
collapsed Versions (2)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (2)Oct 22, 2009 10:29:24 AMPaul Bastide  IBM contributor
1Oct 22, 2009 10:04:28 AMPaul Bastide  IBM contributor
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedHelpAbout
  • IBM Collaboration Solutions wikis
  • IBM developerWorks
  • IBM Software support
  • Twitter LinkIBMSocialBizUX on Twitter
  • FacebookIBMSocialBizUX on Facebook
  • ForumsLotus product forums
  • BlogsIBM Social Business UX blog
  • Community LinkIBM Collaboration Solutions
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Accessibility
  • IBM Terms of use
  • Wiki terms of use