DDE Server using Word 2003

J

Jessica

Good afternoon,

This is actually in relation to my previous question, apparently not
alot of people know about PowerTerm Enterprise, so lets revise the approach.

How would I create a vba macro with a keybind, that makes Word 2003,
the DDE Client and requests information from PowerTerm (I have the servername
and topic, PTW and PSL respectively), or if there is a way to make a macro in
Word that would automatically paste from the clipboard at the push of a
button, that would be much easier as well.

I have limited VBA programming abilities, so the easiest it could be
spelt out the better. Using examples, and not from the "Help" content of
Office, I've already tired that and I didn't get very far

Thanks for your time,

Jessica.
 
R

Russ

Jessica,
In Word VBA Help, one way is to use:
Selection.Paste

That will paste over the selection or at the insertion point.

That's the same thing you would get if you recorded a macro using the menu
Edit/Paste. You could do so and use menu Tools/Customize to add a link to
your macro to a toolbar button, menu, or keystroke combination.
 
M

Michael Bednarek

[snip]
How would I create a vba macro with a keybind, that makes Word 2003,
the DDE Client and requests information from PowerTerm (I have the servername
and topic, PTW and PSL respectively), or if there is a way to make a macro in
Word that would automatically paste from the clipboard at the push of a
button, that would be much easier as well.

Look at VBA Help for the method DDEInitiate; it should get you started
to pull data into MS Word via DDE from Powerterm - if that supports DDE.
Or just press Ctrl+V in MS Word to paste the current content of the
clipboard into the MS Word document.

If you want/need to control it from PowerTerm, that program needs to be
able to use COM objects. Then you can remotely control MS Word with
something like:
Set objWrd = CreateObject("Word.Application")
or
Set objWrd = GetObject(,"Word.Application")
and subsequently manipulate objWrd with methods of MS Word.

Or you can write a VBS program which controls both applications via a
combination of DDE (PowerTerm) and COM/OLE (MS Word).

I think it's also possible to talk to MS Word via DDE, but that approach
is now deprecated and I have no idea what the topics and commands for MS
Word are.
I have limited VBA programming abilities, so the easiest it could be
spelt out the better. Using examples, and not from the "Help" content of
Office, I've already tired that and I didn't get very far

That's exactly how I learned VBA - no gain without pain.
 
J

Jessica

Thanks for you help Michael.

I may have to live with copying and pasting from the clipboard, since
PowerTerm at least on the terminals all of us use have VB disabled.
Otherwise, I'd use VB.

I am forced to use the PowerTerm scripting language, that being said maybe
sometime down the line, after I do a bit more research with the company that
makes PowerTerm, they might have some ideas how to integrate it more with
Word.

I have tried using DDE via Word, but PowerTerm doesn't like to be the
server, it prefers to be the client when it isn't talking to itself (Thanks
to the PSL needed).

If anyone happens to think of anything else, please let me know. I will be
watching the discussion board and maybe someone else will have the same
trouble with a similar issue.
 
P

Peter Jamieson

As Michael says, DDE is deprecated and if you need to use Word as a server
it's better to use COM/OLE Automation if possible.

If you're forced to use DDE, there are quite a few old articles in the MS
Knowledgebase that may help, e.g.

WD: Running Word for Windows as a DDE Server
http://support.microsoft.com/kb/93657/en-us

How to Run a WordBasic Macro from an MS Excel Macro
http://support.microsoft.com/kb/128405/en-us

(which demonstrates both DDE and OLE)

Precisely what works and what does not, and in which versions of Word, I
leave you to discover.

Peter Jamieson
 
J

Jessica

I do thank you all for the help.

Apparently the DDE is the only option and PowerTerm is such an outdated
program (IE their own scripting langauge is) I have settled on the ctrl+v
method of pasting. It would be nice to do it with one button, saving time
and keystrokes, but this should also elminate any and all typos occuring from
the transferance of one program to the next.

I appreciate the help.

Jessica
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top