Interacting with MS Word

Ideas and suggestions about new features
User avatar
paul1149
Posts: 301
Joined: Tue Oct 13, 2009 9:35 pm

Interacting with MS Word

Post by paul1149 »

Hi,

Has anyone done anything to make The Word work directly with MS Word? My previous Bible prog used SmartTags to do so, and they worked well. Another Bible prog has a Word macro that imports verses.

Has either of these methods been developed, or is there a key to accessing TW's API that I could use to work up a Word macro myself?

Blessings,
p.
csterg
Site Admin
Posts: 8627
Joined: Tue Aug 29, 2006 3:09 pm
Location: Corfu, Greece
Contact:

Re: Interacting with MS Word

Post by csterg »

Hi Paul,
unfortunately there is no such api. I have thought of implementing one, but time has not allowed at this moment.
The closer you can get is to use the CTRL+C -> CTRL+SHIFT+V -> CTRL+V combination to convert verse references you type in full text.
How useful would that be anyway?
Costas
User avatar
paul1149
Posts: 301
Joined: Tue Oct 13, 2009 9:35 pm

Re: Interacting with MS Word

Post by paul1149 »

Wow, I wasn't aware of Ctrl-Shift-v! This is almost as good as the SmartTags. Actually, it probably is just as good, as I think I can take advantage of the other prog's STs. I have a macro that finds the last ST and then executes it. I should be able to adapt that to find the ST and then execute C-S-v in TW.

Thanks, Costas, and Blessings,
Paul
User avatar
paul1149
Posts: 301
Joined: Tue Oct 13, 2009 9:35 pm

Re: Interacting with MS Word

Post by paul1149 »

Just a follow-up. I am unable to incorporate Ctrl-Shift-v into my VBA find-paste-format macro, because there is no SendKeys command for doing so (contrary to the VBA Help file). I'm not sure SendKeys would work anyway. And neither does the Send command of an Auto-It macro work.

Nonetheless C-S-v is very helpful, and I can manually incorporate it with a the formatting part of the macro I use in Word.

Thanks and God bless,
Paul
User avatar
paul1149
Posts: 301
Joined: Tue Oct 13, 2009 9:35 pm

Re: Interacting with MS Word

Post by paul1149 »

I think I'm in business. Adding a DoEvents VBA routine to kill time allowed the Auto-It macro to do its thing. There's now a little delay built into the macro, but it seems to be working fine.

Paul
csterg
Site Admin
Posts: 8627
Joined: Tue Aug 29, 2006 3:09 pm
Location: Corfu, Greece
Contact:

Re: Interacting with MS Word

Post by csterg »

paul1149 wrote:I think I'm in business. Adding a DoEvents VBA routine to kill time allowed the Auto-It macro to do its thing. There's now a little delay built into the macro, but it seems to be working fine.

Paul
The DoEvents processes messages from the windows queue, so this could be what was missing.
Costas
User avatar
paul1149
Posts: 301
Joined: Tue Oct 13, 2009 9:35 pm

Re: Interacting with MS Word

Post by paul1149 »

Maybe that's it. Stepping through the macro worked, but Running it didn't. So I thought it needed more time to call out the external Auto-It macro. But the Sleep command didn't work, whereas DoEvents does, even though the routine seems to be a mere placekeeper:

Sub timer2(X)
Over = timer + X
While timer < Over
DoEvents
Wend
End Sub

So maybe Sleep was too strong a command, while DE lets the macro process.

Currently the delay is set for one second; I'm going to try to pare that down. But otherwise, I'm delighted to automate the verse capture/clean-up/formatting process in Word again.
User avatar
paul1149
Posts: 301
Joined: Tue Oct 13, 2009 9:35 pm

Re: Interacting with MS Word

Post by paul1149 »

If there's any interest I'd be happy to post the macros.
gennesse
Posts: 103
Joined: Tue Jan 22, 2008 4:10 pm
Location: Nederland

Re: Interacting with MS Word

Post by gennesse »

I am interested, can you say what it does exactly?

Thanks Richard
User avatar
paul1149
Posts: 301
Joined: Tue Oct 13, 2009 9:35 pm

Re: Interacting with MS Word

Post by paul1149 »

It does a few things, and not all aspects would have to be invoked, depending on your needs.
  • It selects the last scripture reference before the cursor, and captures and pastes the Bible text.
  • It cleans up the text by stripping such things as font face, superscript and brackets (the version I often use, MKJV, uses a lot of brackets to designate inserted text).
  • It joins the reference line at the bottom to the end of the last verse.
  • It applies my designated Word paragraph style used for Bible quotations.
  • Finally it creates the next paragraph, using Body Text, so I can continue writing.
To use all the functions requires two things: installation of Logos SmartTags, and the Auto-It macro engine.

If you do a bit of writing, this macro ends up saving a ton of repetitive work.
cornopean
Posts: 109
Joined: Wed Jan 13, 2010 5:24 am
Contact:

Re: Interacting with MS Word

Post by cornopean »

csterg wrote:Hi Paul,
unfortunately there is no such api. I have thought of implementing one, but time has not allowed at this moment.
The closer you can get is to use the CTRL+C -> CTRL+SHIFT+V -> CTRL+V combination to convert verse references you type in full text.
How useful would that be anyway?
Costas
I think this would be a waste of time. copying and pasting is so easy.
“There is a danger of being a Pharisee when thou ceasest being a Publican.” --Anthony Burgess
RubioTerra
Posts: 732
Joined: Wed Sep 23, 2009 5:13 pm
Location: Brasília, Brazil

Re: Interacting with MS Word

Post by RubioTerra »

I trying to answer a friend who asked me the best way to get the text of several verse references and paste it to an external editor. I promptly thought of the sequence Ctrl+C, Ctrl+Shift+V, Ctrl+V. I expected the shortcut Ctrl+Shift+V to copy the text of all recognized verse references to the clipboard. But it copies just the first verse. Is it supposed to work like that?
I know I can send all recognized verses to a verse list and then copy all verses to the clipboard, but why should I have to employ a different procedure for many verses as opposed to one verse?
Rúbio R. C. Terra
Brasília/DF - Brasil
RubioTerra
Posts: 732
Joined: Wed Sep 23, 2009 5:13 pm
Location: Brasília, Brazil

Re: Interacting with MS Word

Post by RubioTerra »

Please don't forget me... :mrgreen:
Rúbio R. C. Terra
Brasília/DF - Brasil
csterg
Site Admin
Posts: 8627
Joined: Tue Aug 29, 2006 3:09 pm
Location: Corfu, Greece
Contact:

Re: Interacting with MS Word

Post by csterg »

fixed in b1414. Sorry for the delay, i was away.
Costas
RubioTerra
Posts: 732
Joined: Wed Sep 23, 2009 5:13 pm
Location: Brasília, Brazil

Re: Interacting with MS Word

Post by RubioTerra »

Thanks a lot!
Rúbio R. C. Terra
Brasília/DF - Brasil
Post Reply