OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

DDE Application Name, Topic and Command for Open Office

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
mwildman
Newbie
Newbie


Joined: 06 Aug 2010
Posts: 1

PostPosted: Fri Aug 06, 2010 10:31 am    Post subject: DDE Application Name, Topic and Command for Open Office Reply with quote

I'm using an external program (WinWedge) and want to issue a DDE command that runs a macro in my open office document.

To establish a DDE Link and send a command in WinWedge, I need to know these three items for open office:

DDE Application Name
DDE Topic
DDE Command

From what I've read on the wiki and support forums, DDE functionality is limited. But I have so far been able to use DDEInitiate, DDERequest, and DDETerminate in star basic to successful grab data from WinWedge, so I'm hoping there is some way to flip the scenario and make a request to open office to run a macro.

Here's my working code in open office


Code:
Sub GetSWData()

Dim R As Long
Dim NumFields As Long
Dim Chan As Long
Dim Sheet
Dim data As String

R = 0
NumFields = 2

Chan = DDEInitiate("WinWedge", "Com1")

Sheet = thisComponent.Sheets("Sheet1")

'DATE AND TIME
Cell = Sheet.getCellByPosition(0, R)
Cell.Value = Now

For X = 1 To NumFields   
   
   data = DDERequest(Chan, "Field(" & Cstr(X) & ")")
   
   Cell = Sheet.getCellByPosition(X, R)
   Cell.Value = data

Next

DDETerminate (Chan)

End Sub


Any help or advice is appreciated!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group