Filename passed to WLL differs in 2007

A

ANB

I have a WLL written using the WordBasic C API from way back when. When a
document is opened it takes some action based on the filename (retrieved
using wdFileNameInfo). This worked fine in 2003 and below, but the filename
it is given in 2007 differs from the actual name of the file; instead it is
given a copy of the file in Temporary Internet Files with a random-looking
name.

I haven't been able to find any information about this behavior. Is there a
possible work-around?

Also, supposing I wanted to port this WLL to something a bit more modern,
what is the preferred way of creating extensions to word?
 
A

ANB

ANB said:
I have a WLL written using the WordBasic C API from way back when. When a
document is opened it takes some action based on the filename (retrieved
using wdFileNameInfo). This worked fine in 2003 and below, but the filename
it is given in 2007 differs from the actual name of the file; instead it is
given a copy of the file in Temporary Internet Files with a random-looking
name.

I haven't been able to find any information about this behavior. Is there a
possible work-around?

Also, supposing I wanted to port this WLL to something a bit more modern,
what is the preferred way of creating extensions to word?

Some updates: I've found that the behavior of WordBasic.FileName$ differs in
2007 compared with other versions, but only when the document is opened from
a UNC path. So, this:

Sub Foo()
myFN = WordBasic.FileName$()
ActiveDocument.Content.InsertAfter(myFN)
End Sub

Will write the correct filename when the document is on a local drive and
will write "C:\Documents and Settings\<user>\Local Settings\Temporary
Internet Files\Office.MSO\<foo>.docx" when the document was opened from a UNC
path or mapped drive.
 

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