System PrivateProfileString not working
This is specifically a Mac problem. I've got a user template I've been using for years with Office 2003 and 2007. I use the PrivateProfileString method to read/write from a text file. However, when I try to do the same thing in Word 2011 (i.e. the Mac version),
I run into problems.
This:
MsgBox System.PrivateProfileString("Macintosh HD:Users:theostar:Documents:txtExpress_2011:initest.txt", "locaties", "xee")
results in an empty message box.
This:
System.PrivateProfileString("Macintosh HD:Users:theostar:Documents:txtExpress_2011:initest.txt", "locaties", "xee") = "wwgd"
returns the following error message:
Run-time error '-2147483640 (80000008) Method ;PrivateProfileString' of object 'System' Failed
I ran a search on the web and found one mention on a forum. Apparently this user had the exact same problem. One of the answers he received was that Microsoft might not have implemented the PrivateProfileString in VBA for Office 2011. The user also mentioned
that the same code actually worked in Word 2004.
So, I'm wondering: Am I doing something wrong? Or is it true that this method wasn't implemented in 2011? If not, is there a workaround?
Any answers will be very much appreciated.
Thanks in advance and best regards,
Theo van der Ster
The Netherlands