How to call a Word VBA function?
How to call a Word VBA function?
- Subject: How to call a Word VBA function?
- From: Richard Rönnbäck <email@hidden>
- Date: Fri, 16 Jan 2004 12:26:13 +0100
I am trying to do what I thought shouldn't be that hard but I am now totally
lost.
I am trying to get the document title from a Microsoft Word X document (the
title you fill in via File>Properties>Summary>Title)
Since it not exposed to AppleScript I thought I could stitch it together
with VBA, but despite reading Microsoft step by step article
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:
80/support/kb/ARTICLES/Q184/4/40.asp&NoWebContent=1
over and over again I still don't get it.
Since I want a value back I assume it must be a function, which is (and it
does seem to work as expected):
Function GetTitle(strWordTitle As String) As String
Dim dp As Object
Set dp = ActiveDocument.BuiltInDocumentProperties
strWordTitle = dp(wdPropertyTitle)
End Function
I have then, with endless variations, tried to call from, and get the value
back to, the AppleScript, but to no avail. It should be something like:
tell application "Microsoft Word"
tell document 1
do script "GetTitle()"
set myTitle to the result
end tell
end tell
Can anyone help me?
_______________________________________________
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.