|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Code on a button to attach a document to my Word Auto fill document is not working on a Mac
Hello
I designed a Word document that gives users the option to select a button so that they can select a document and once selected, the document will be attached. This works fine on a PC. However, on a Mac it does not work. I have been investigating this issue for days now and the code below is the code on the button. Dim MyPath As String Dim OneFile As Boolean OneFile = True MyPath = MacScript("return (path to desktop folder) as String") If Val(Application.Version) < 15 Then If OneFile = True Then MyScript = _ "set theFile to (choose file of type" & _ " " & FileFormat & " " & _ "with prompt ""Please select a file"" default location alias """ & _ MyPath & """ without multiple selections allowed) as string" & vbNewLine & _ "return theFile" End If Else If OneFile = True Then MyScript = _ "set theFile to (choose file of type" & _ " " & FileFormat & " " & _ "with prompt ""Please select a file"" default location alias """ & _ MyPath & """ without multiple selections allowed) as string" & vbNewLine & _ "return posix path of theFile" End If End If MyFiles = MacScript(MyScript) FileName:=MyFiles, _ LinkToFile:=False, _ DisplayAsIcon:=True, _ IconLabel:=Right(MyFiles, Len(MyFiles) - InStrRev(MyFiles, "/")) I do not have a Mac so when I sent a test form with this code on a button to a user with a Mac it is still failing. On a PC as I mentioned it works fine. The user selects a document and the document attaches as a icon. Is there any way this can be done on a Mac. Any help would be greatly appreciated. Also should I use AppleScriptTask instead of MacScript. Thanks in advance. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PRINT field code in Word document not working as expected | smccaffr39 | Word | 3 | 02-19-2020 02:46 PM |
Button with VBA to attach a file in a protected document | wolfgrrl | Word VBA | 6 | 09-20-2019 07:38 AM |
Best way to attach a Word document to Outlook Reply message | mitjad | Office | 4 | 04-09-2019 03:55 PM |
Word type document auto fill in | Sircooks | Excel | 5 | 05-14-2016 05:01 AM |
File Not Found error when trying to attach Word document to email | Kimber | Word | 0 | 03-06-2015 06:47 PM |