G
G.Miller
hi,
just finished upgrading to 2008 from office X and am trying to get a
handle on things.
i currently have an applescript that uses VBA to take information from
a filemaker pro database and paste it into a word document. (script
shown at end of message)
the beginning of the script should still be fine, but im confused as
to what to substitute for the "do visual basic" lines.
basically, im looking for a way to insert the current date, insert a
table, and paste some text.
any examples or help is greatly appreciated, thanks.
G.Miller
tell application "FileMaker Pro"
tell layout "Create Estimate"
set mycontactaddress to cellValue of field "contact_address" of
current record
set mycontactnumbers to cellValue of field "contact_numbers" of
current record
set myestimatebody to cellValue of field "calc_compiled" of current
record
end tell
end tell
tell application "Finder"
set {text:mycontactaddress} to (mycontactaddress as string)
set {text:mycontactnumbers} to (mycontactnumbers as string)
set {text:myestimatebody} to (myestimatebody as string)
open file "letterhead" of desktop
end tell
tell application "Microsoft Word"
activate
do Visual Basic "Selection.MoveDown Unit:=wdLine, Count:=2"
do Visual Basic "Selection.TypeParagraph"
do Visual Basic "Selection.InsertDateTime DateTimeFormat:=\"MMMM d,
yyyy\", InsertAsField:= False"
do Visual Basic "Selection.TypeParagraph"
do Visual Basic "Selection.TypeParagraph"
do Visual Basic "ActiveDocument.Tables.Add Range:=Selection.Range,
NumRows:=1, NumColumns:=2, DefaultTableBehavior:=wdWord9TableBehavior,
AutoFitBehavior:=wdAutoFitFixed"
do Visual Basic "Selection.Tables(1).AutoFormat
Format:=wdTableFormatSimple1, ApplyBorders:=False,
ApplyShading:=False, ApplyFont:=False,
ApplyColor:=False,ApplyHeadingRows:=False, ApplyLastRow:=False,
ApplyFirstColumn:=False,ApplyLastColumn:=False, AutoFit:=False"
set contents of selection to mycontactaddress
do Visual Basic "Selection.MoveRight Unit:=wdCell"
do Visual Basic "Selection.ParagraphFormat.Alignment =
wdAlignParagraphRight"
set contents of selection to mycontactnumbers
do Visual Basic "Selection.MoveDown Unit:=wdLine, Count:=1"
do Visual Basic "Selection.TypeParagraph"
do Visual Basic "Selection.ParagraphFormat.Alignment =
wdAlignParagraphJustify"
set contents of selection to myestimatebody
end tell
just finished upgrading to 2008 from office X and am trying to get a
handle on things.
i currently have an applescript that uses VBA to take information from
a filemaker pro database and paste it into a word document. (script
shown at end of message)
the beginning of the script should still be fine, but im confused as
to what to substitute for the "do visual basic" lines.
basically, im looking for a way to insert the current date, insert a
table, and paste some text.
any examples or help is greatly appreciated, thanks.
G.Miller
tell application "FileMaker Pro"
tell layout "Create Estimate"
set mycontactaddress to cellValue of field "contact_address" of
current record
set mycontactnumbers to cellValue of field "contact_numbers" of
current record
set myestimatebody to cellValue of field "calc_compiled" of current
record
end tell
end tell
tell application "Finder"
set {text:mycontactaddress} to (mycontactaddress as string)
set {text:mycontactnumbers} to (mycontactnumbers as string)
set {text:myestimatebody} to (myestimatebody as string)
open file "letterhead" of desktop
end tell
tell application "Microsoft Word"
activate
do Visual Basic "Selection.MoveDown Unit:=wdLine, Count:=2"
do Visual Basic "Selection.TypeParagraph"
do Visual Basic "Selection.InsertDateTime DateTimeFormat:=\"MMMM d,
yyyy\", InsertAsField:= False"
do Visual Basic "Selection.TypeParagraph"
do Visual Basic "Selection.TypeParagraph"
do Visual Basic "ActiveDocument.Tables.Add Range:=Selection.Range,
NumRows:=1, NumColumns:=2, DefaultTableBehavior:=wdWord9TableBehavior,
AutoFitBehavior:=wdAutoFitFixed"
do Visual Basic "Selection.Tables(1).AutoFormat
Format:=wdTableFormatSimple1, ApplyBorders:=False,
ApplyShading:=False, ApplyFont:=False,
ApplyColor:=False,ApplyHeadingRows:=False, ApplyLastRow:=False,
ApplyFirstColumn:=False,ApplyLastColumn:=False, AutoFit:=False"
set contents of selection to mycontactaddress
do Visual Basic "Selection.MoveRight Unit:=wdCell"
do Visual Basic "Selection.ParagraphFormat.Alignment =
wdAlignParagraphRight"
set contents of selection to mycontactnumbers
do Visual Basic "Selection.MoveDown Unit:=wdLine, Count:=1"
do Visual Basic "Selection.TypeParagraph"
do Visual Basic "Selection.ParagraphFormat.Alignment =
wdAlignParagraphJustify"
set contents of selection to myestimatebody
end tell