home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
80 Mega Hits Shareware
/
80megahitssharewaretitaniumseal.iso
/
winpack
/
addrmana
/
macros.tx_
< prev
next >
Wrap
Text File
|
1993-01-28
|
3KB
|
87 lines
The following two macros are Word For Windows 2.0 macros
that you can play with. They illustrate how to use the
new DDE protocol. If you are not familiar with programming
Word For Windows macros, its best not to try to get involved
with this file.
==============================================================
This is the SelectNameGetAddress macro. It should be self
explanatory if you run it.
Sub MAIN
On Error Goto Done
ChanNum = DDEInitiate("address", "DDE.ADD")
NotDone = 1
Dim NumNames$(5)
Dim ListName$(64)
NumNames$ = DDERequest$(ChanNum, "c [Current List]")
ListName$ = "List: " + DDERequest$(ChanNum, "l")
Dim ListBox1$(Val(NumNames$))
ListBox1$(0) = ""
wItems = Val(NumNames$)
ListBox1$(0) = DDERequest$(ChanNum, "uf [Current List] %NAME")
ctr = 1
While ctr < wItems
ListBox1$(ctr) = DDERequest$(ChanNum, "un")
ctr = ctr + 1
Wend
Begin Dialog UserDialog 420, 160, "Choose Name"
OKButton 320, 30, 88, 21
CancelButton 320, 59, 88, 21
Text 20, 12, 380, 12, ListName$
ListBox 20, 30, 289, 124, ListBox1$(), .Index
End Dialog
Dim TestDialog As UserDialog
Dialog TestDialog
If ListBox1$(TestDialog.Index) <> "" Then Insert DDERequest$(ChanNum, "uf [Current List] " + \
"[" + ListBox1$(TestDialog.Index) + "]" + \
"%NAME%CR" + \
"%A1%CR%A2%CR%A3%CR" + \
"%CITY% %ST%, %ZIP%CR")
Done:
DDETerminate(ChanNum)
End Sub
=========================================================================
This is a macro that gets all the names from a specified list.
Sub MAIN
Dim Data$(500)
ChanNum = DDEInitiate("address", "DDE.ADD")
Insert DDERequest$(ChanNum, "uf [All Addresses] [A Luther] %SAL% %FN" + \
"% %LN%CR%A1" + \
"% %A2%CR%A3%CITY% %ST%, %ZIP%CR" + \
"%Home Phone: %HP%CR" + \
"%Work Phone: %WP% %Ext. %WE%CR" + \
"%Fax Phone: %FP%CR" + \
"%His Birthday: %HISB%CR" + \
"%Her Birthday: %HERB%CR" + \
"%Anniversary: %AN%CR" + \
"%Comment: %CMT%CR%CR")
NotDone = 1
While NotDone
Data$ = DDERequest$(ChanNum, "un")
If Data$ = "" Then NotDone = 0 Else Insert Data$
Wend
DDETerminate(ChanNum)
End Sub