Re: Problem with Applescript PASTE function in MS Word

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.

.



Relevant Pages

  • Re: Trailing blanks in batch file
    ... Same applies to parentheses and quotes, ... problem as there *being* a trailing space whose presence creates a problem. ... If someone exclusively used an editor that displayed blanks as grey dots, ... can never be sure that one's script will never be edited by someone else ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: Writing and debugging VBS
    ... rem that out temporarily then re-run your script and see what ... > Editor in Excel or Word, in the hope that the editor would step through ... > screen changed for a few seconds, before reverting to the design mode. ... > (in a similar way to the VBA editor) to step through my VBS code? ...
    (microsoft.public.scripting.vbscript)
  • Re: "Gehirnsimulator"
    ... Die Seiten wurden/werden mit Netscapes WYSIWYG HTML ... Editor Composer erzeugt und werden soweit ich ... lasse sie von einem Script erzeugen. ...
    (de.sci.electronics)
  • Re: JScript syntax higlihting in VIntDev
    ... :: JScript files and highlighted the syntax. ... select the HTML Editor and set the editor to come up in Source View. ... Document to link script ... : function doThis() { ...
    (microsoft.public.scripting.jscript)
  • Re: looking for a decent IDE for VBScripting
    ... script editor" is serviceable. ... IDE sounds a little off-base to me, ... a text editor and a "run" ... I would like to suggest the scintilla ...
    (microsoft.public.scripting.vbscript)