Re: Problem with Applescript PASTE function in MS Word
- From: Paul Berkowitz <berkowit@xxxxxxxxxxxxxxxx>
- Date: Sun, 08 May 2005 08:08:32 -0700
On 5/7/05 1:28 PM, in article
1115497729.985971.252990@xxxxxxxxxxxxxxxxxxxxxxxxxxxx, "Micheal"
<micmarsh@xxxxxxxxxxx> wrote:
> Thanks, it almost got me there, but then I ran into another error with
> Visual Basic. I hadn't known about the change in MS Word, but it still
> doesn't work for me. I have many couples in my entrourage with
> different last names, but that I keep together. I had originally
> gotten the script from George Clark on this or another board, then
> later I got your update. (It has been awhile and I can't remember the
> exact line of events, hence I inculded the copywrite line) I have
> modified it so that it addresses the envelope using both last names, or
> another script to address it to just the person or to just their
> spouse. MS Word still can't do this name swapping for me.
>
> Anyhow, I made the change, but then the MS Visual Basic debugger opened
> with this error. The first line had a yellow highlight and red arrow
> next to it and the line "ActiveDocument....." was highlighted with the
> system highlight. I'm completley clueless on even reading what this
> means. I have put **** in the name and addresses that it showed. Can
> you help me out with this.
>
> Sub TmpDDE()
> recep = "************" & vbCr & "********************" & vbCr & _
> "*************************"
> retaddr = "***************" & vbCr & "**********************" &
> vbCr & _
> "*******************" & vbCr & "***********************"
> ActiveDocument.Envelope.PrintOut Address:=recep, _ "& vbLf &"
> ReturnAddress:= _
> retaddr, PrintBarCode:=True
> End Sub
Michael, I really can't sit here trying to debug a deprecated script that I
didn't write. (I can't recall editing George's script: I later wrote my own
"Print Envelopes" script which you can find in the Office for Office
package. But it too might have a few non-VB commands which need to be
changed for Word 2004.)
My guess would be that you opened the script in OS X's Script Editor and
recompiled and saved, so that the carriage returns within literal quoted
strings - which is what the entire 'do Visual Basic' command is (it's all in
"quotes") now contains Unix Linefeeds rather than Mac Carriage Returns, so
now the VB Editor is not seeing them as separate lines. You see where that
Address:=recep, _ "& vbLf &"
occurs? Nothing should be following the _ on the same line. The _ is a
continuation character at the end of a line, but the following carriage
return isn't there. Just possibly a little trick _might_ save it. If you
change that vbLf to vbCr it just might fix it. (George should not have used
vbLf anyway - it should have been vbCr - but it didn't really matter before.
Here it just might make the VB Editor happy, though I wouldn't hold out much
hope.
As I suggested last time, just learn to use the Data merge manager in Word
instead.
--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>
Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.
PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
.
- Follow-Ups:
- Re: Problem with Applescript PASTE function in MS Word
- From: Micheal
- Re: Problem with Applescript PASTE function in MS Word
- References:
- Re: Problem with Applescript PASTE function in MS Word
- From: Micheal
- Re: Problem with Applescript PASTE function in MS Word
- From: Paul Berkowitz
- Re: Problem with Applescript PASTE function in MS Word
- From: Micheal
- Re: Problem with Applescript PASTE function in MS Word
- Prev by Date: Re: Spotlight on Word problems
- Next by Date: spell checker
- Previous by thread: Re: Problem with Applescript PASTE function in MS Word
- Next by thread: Re: Problem with Applescript PASTE function in MS Word
- Index(es):
Relevant Pages
|