Re: Microsoft Word do Visual Basic
Re: Microsoft Word do Visual Basic
- Subject: Re: Microsoft Word do Visual Basic
- From: Simon Forster <email@hidden>
- Date: Wed, 2 Jul 2003 12:21:41 +0100
On Tuesday, July 1, 2003, at 07:38 pm, Paul Berkowitz wrote:
I can run 1 line "do Visual Basic" commands without a problem but as
soon as I have a second line, the "do Visual Basic" script step fails.
The VBA compiler seems to be reading your line endings as Unix-type
linefeeds, known to VBA as the constant 'vbLf'. It wants CR carriage
returns
for line separators.
Well, I've tried Paul's function to replace linefeeds with carriage
returns and got the same problem, namely:
/////////////////VB_Error /////////////////
Sub TmpDDE()
Dim sTitle As String"& vbLf &"sTitle = "This is a string in Skia
bold""& vbLf &"Selection. _
InsertAfter Text:=sTitle"& vbLf &"With Selection.Font"& vbLf &"
.Name = "Skia""& vbLf &" . _
Size = 12"& vbLf &" .Bold = True"& vbLf &" .SmallCaps =
True"& vbLf &"End With"& vbLf &"With Selection. _
ParagraphFormat"& vbLf &" .LineSpacingRule =
wdLineSpace1pt5"& vbLf &" .Alignment = _
wdAlignParagraphCenter"& vbLf &"End With"& vbLf
&"Selection.Collapse Direction:= _
wdCollapseEnd
End Sub
///////////////// VB_Error /////////////////
My guess is that Word is doing the change to line ends as doing so
incorrectly.
Question: Is anyone using AppleScript to run a multiline VB Script
targeting Microsoft Word vX service pack 1? I've tried both Script
Editor 1.9 and 2.0 now.
TIA
Simon Forster
___________________________________________________
LDML Ltd, Office One, 16 Canham Road, London, W3 7SR, UK
Tel: +44 (0)20 8749 7766 Fax: +44 (0)70 9230 5247
___________________________________________________
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.