Hi,
I'm using MacOS X (10.3.8) and Microsoft Word for Mac Release 1, and I have a problem with the Visual Basic macro editor :
I need a pathname to reference a folder "Reports" that always resides on the Desktop (I create it if it does not exist).
On Windows, this is done this way :
"~/Desktop/Reports/"
But on MacOS X, slashes are not permitted in pathnames. We have to use colons instead. Still, this does not work :
"~

esktop:Reports:"
Which could be the correct syntax on MacOS X ?
Thanks for your help
Bart,
I think I've figured it out. I searched online and through the Object Browser directly in the Visual Basic Editor in Word, and couldn't find anything that would give us the home folder (~). But I found that you can use the MacScript() function to execute any AppleScript.
So what I did (first time playing with VBA before - quite fun) was call the MacScript() function and have AppleScript return the path to the Desktop.
Here's the full code I used (got the file writing code from somewhere else). Let me know if it works!
------
' Name of the file
Const FileName As String = "Test.txt"
' Text to write into the file
Const TestString As String = "Testin123..."
Dim DesktopFolder As String
Dim FullPath As String
' Call AppleScript to get the Desktop folder
DesktopFolder = MacScript("return (path to desktop) as string")
' Append the FileName to DesktopFolder
FullPath = DesktopFolder & FileName
' Write the file (just for testing)
Dim FileNum As Integer
FileNum = FreeFile
Open FullPath For Append As #FileNum
Print #FileNum, TestString
Close #FileNum
------
Also, I did some testing before all of this and you do need to use : as the path delimiter. If you will be writing code for Windows, then you would want to the Application.PathSeparator to get the file delimiter (: for Mac, \ for Windows I'd imagine). The ~ doesn't appear to work. And :Users... doesn't work either. You need to use something like "Macintosh HD:Users:kainjow

esktop:Reports" if you hard coded it in, but that obviously won't work because you need know the username.
Try the above code and let me know if it helps. If this document is going to have to work on Macs and Windows, then you'd need to do some if-then checking to see which OS it's running on (not sure of how to do this at the moment).
Kevin
Oh, and for the path delimiter (: or \ or /) you can use the Application.PathSeparator constant and that will give you the correct separator for Mac and Windows.
Kevin