• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to call a Word VBA function?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: How to call a Word VBA function?
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Delete log files by date
  • Next by Date: Connect to SMB server
  • Previous by thread: Re:Delete Log files by date
  • Next by thread: Re: How to call a Word VBA function?
  • Index(es):
    • Date
    • Thread