Opening Word Docs from Excel VBA With full path and name > 255 chars

C

Chrisso

Hi All

I have written some Excel VBA code to open Word documents. I gather
the full path and name in a string.

Dim sFullPathAndName As String
sFullPathAndName = fldrTarget.Path &
Application.PathSeparator & fTarget.Name
Word.Application.Documents.Open sFullPathAndName,
ReadOnly:=True

Sometimes when I then pass this string to
Word.Application.Documents.Open and it is greater than 255 chars I get
the error:

Run-time error '9105'
String is longer than 255 characters.

How can I open these documents with full path and name > 255
characters.

Thanks in advance for any ideas.
Chrisso
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top