Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

akiev

macrumors newbie
Original poster
Oct 30, 2012
2
0
I've spent hours on figuring out how to do this. There is an "API" for inserting images (like make inline picture), but I did not find anything about how to insert a sound into the Word document (2011 Office). Any help will be appreciated. Thanks
 
Looked in the dictionary and could not find anything usable. You can always use UI scripting.

Example from Dutch version of Word 2011 :

Code:
GUIScripting_status()

activate application "Microsoft Word"
tell application "System Events"
	tell process "Microsoft Word"
		-- insert GUI Scripting statements here
		click menu item "Geluid uit bestand..." of menu 1 of menu item "Audio" of menu 1 of menu bar item "Invoegen" of menu bar 1
	end tell
end tell

on GUIScripting_status()
	-- check to see if assistive devices is enabled
	tell application "System Events"
		set UI_enabled to UI elements enabled
	end tell
	if UI_enabled is false then
		tell application "System Preferences"
			activate
			set current pane to pane id "com.apple.preference.universalaccess"
			display dialog "This script utilizes the built-in Graphic User Interface Scripting architecture of Mac OS x which is currently disabled." & return & return & "You can activate GUI Scripting by selecting the checkbox \"Enable access for assistive devices\" in the Universal Access preference pane." with icon 1 buttons {"Cancel"} default button 1
		end tell
	end if
end GUIScripting_status

Invoegen = Insert
Audio = Audio
Geluid uit bestand... = Sound from file...(not sure about this)
 
Yes, this is exactly what I'm doing now. But when the sound inserted using UI scripting - it appears in the top left corner, but I need to make it inline with text.
Thanks
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.