tags:

views:

286

answers:

3

I have this in my Word Macro

ActiveDocument.SaveAs FileName:="D:\\GrooveAndRock\\GrooveAndRock\\GrooveAndRock\\GrooveAndRock\\GrooveAndRock\\GrooveAndRock\\GrooveAndRockAndRoll\\GrooveAndRockAndRoll\\GrooveAndRockAndRoll\\GrooveAndRockAndRoll\\GrooveAndRockAndRoll\\GrooveAndRockAndRoll\\Ug F Blug and Bug f Goo - Blank Address - 2009-09-25 093614.doc", FileFormat:=wdFormatDocument, _
     LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword _
    :="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
    SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
    False

(note the long filename)

When I run it, I get : "Run-time error '9105':

String is longer than 255 characters"

Is it really the case that word automation cannot save long filenames? This is a pretty serious limitation, yet a google search on the error has brought up nothing..

Is there a workaround?

Whats going on!??!?

Confused..

+2  A: 

Try using dir function to get into the folder you want and then save it.

Mike
Yes that works!
Mongus Pong
+1  A: 

That's a limitation in Windows:

http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx#maximum_path_length

Anders Lindahl
Wow, you are right. I remember this from my Windows 95 days now! 14 years later and they still havent sorted it out...
Mongus Pong
+1  A: 

That is it: http://msdn.microsoft.com/en-us/library/zw949162.aspx

Remou