Is This Content Helpful?
We're glad to know this article was helpful.
In this example, the Visual Basic application sends Avenue requests to ArcView that create new documents, such as views and layouts. Additionally, the application can query ArcView to obtain the current active document. The Visual Basic application is the destination application, while ArcView is the source application.
Visual Basic and ArcView must be installed to perform the following steps.
Object Property Setting
Text Box Name txtDDE
Command Button Caption Send Request
Combo Box Name cboDocType
Const NONE = 0, MANUAL = 2
Sub Startup() 'Note: Visual Basic will create this subroutine
'in a separate window from the general declarations
Const DDE_NO_APP = 282 'error if no response
'see Trappable errors
'this will start ArcView if it isn't running
On Error GoTo FireUp
txtDDE.LinkMode = NONE 'Clear DDE Link
txtDDE.LinkTopic = "ArcView|System" 'Set up conversation
txtDDE.LinkMode = MANUAL 'Establish a manual link
If Err = DDE_NO_APP Then
ChDir "C:\esri\av_gis30\arcview\bin32" ' wherever ArcView was installed
' the ChDir is required
t = Shell("arcview", 1)
t = DoEvents() 'process Windows events
MsgBox "Unknown error."
Sub Form_Load ()
cboDocType.text = ""
Startup 'calls startup procedure
Sub Form_Unload (Cancel As Integer)
txtDDE.LinkMode = NONE 'Close DDE conversation
cmd = "theDoc = av.GetProject.AddDoc(" & cboDocType & ".make) av.GetProject.GetSelectedDocs.Get(0).GetWin.Open "
Sub cmdRequest_Click ()
'When selected this button will request an update of
'information from the source application to the
'LinkItem can be any Avenue script that returns a value
txtDDE.LinkItem = "av.GetActiveDoc.GetName"