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.
Interacting with MS Word
Re: Interacting with MS Word
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
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
Re: Interacting with MS Word
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
Thanks, Costas, and Blessings,
Paul
Re: Interacting with MS Word
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
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
Re: Interacting with MS Word
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
Paul
Re: Interacting with MS Word
The DoEvents processes messages from the windows queue, so this could be what was missing.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
Costas
Re: Interacting with MS Word
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.
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.
Re: Interacting with MS Word
If there's any interest I'd be happy to post the macros.
Re: Interacting with MS Word
I am interested, can you say what it does exactly?
Thanks Richard
Thanks Richard
Re: Interacting with MS Word
It does a few things, and not all aspects would have to be invoked, depending on your needs.
If you do a bit of writing, this macro ends up saving a ton of repetitive work.
- 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.
If you do a bit of writing, this macro ends up saving a ton of repetitive work.
Re: Interacting with MS Word
I think this would be a waste of time. copying and pasting is so easy.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
“There is a danger of being a Pharisee when thou ceasest being a Publican.” --Anthony Burgess
-
- Posts: 732
- Joined: Wed Sep 23, 2009 5:13 pm
- Location: Brasília, Brazil
Re: Interacting with MS Word
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?
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
Brasília/DF - Brasil
-
- Posts: 732
- Joined: Wed Sep 23, 2009 5:13 pm
- Location: Brasília, Brazil
Re: Interacting with MS Word
fixed in b1414. Sorry for the delay, i was away.
Costas
Costas
-
- Posts: 732
- Joined: Wed Sep 23, 2009 5:13 pm
- Location: Brasília, Brazil