Opening file from an item loses Word document properties

A

Alan Silver

Hello,

I have just discovered that when you double-click a Word file attached
to an appointment item (although I imagine it will be the same for other
items too), Outlook does not open the actual file, but takes a copy and
puts it in the temp folder and opens that.

This is a pain as it mucks up some of the automation coding I have done,
but what's worse is that the copy doesn't seem to have the custom
properties I have set.

Is there any way of forcing Outlook to open the original, instead of a
copy? Failing that, any ideas why the custom document property would
have been lost in the copy ?

TIA
 
S

Sue Mosher [MVP-Outlook]

There is no "original" file. The attachment is a binary blob property on the
message. In order to make it usable as a file, Outlook must save it first.

Why does this cause a problem for your automation?

I don't know of any reason why custom document properties wouldn't be
available. Can you provide a test scenario?
 
A

Alan Silver

"Sue Mosher said:
There is no "original" file. The attachment is a binary blob property on the
message. In order to make it usable as a file, Outlook must save it first.

Oh, that explains it. I've got so used to Windows creating shortcuts to
files that I assumed that this was the same.
Why does this cause a problem for your automation?

That itself isn't such a problem for the automation, it's the loss of
properties that is the real problem. This just means that if someone
double-clicks the file from the Outlook item and edits it, when they
save it, it will not just save an updated version of the original. That
makes life difficult for the users.

If I can't get Outlook to open the original file, then the properties
issue isn't relevant anyway as the user will have to open the original
file anyway.
I don't know of any reason why custom document properties wouldn't be
available. Can you provide a test scenario?

I don't know if anything short of the full code I have will demonstrate
the problem. I can happily send you the Word template that contains the
code if you like. I would post it here, but some people seem to object
to binaries posted in these groups (not without reason I might add
before anyone jumps on me !!).

So my bigger issue is, can I add a shortcut to a Word doc instead of the
binary blob ?

Thanx
 
S

Sue Mosher [MVP-Outlook]

If the user opens the message, double-clicks the file, makes changes, saves
the file, then sames the message, the updated file should be stored back in
the message.

You can certainly add a shortcut to a file. Because of security concerns
about attachments, an HTML message body with an <a> link pointing to a
file:// hyperlink would be my choice.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
A

Alan Silver

"Sue Mosher said:
If the user opens the message, double-clicks the file, makes changes, saves
the file, then sames the message, the updated file should be stored back in
the message.

Hmm, not a bad idea, except that the customer will want his Word files
stored in his hard disk as files.

Still, worth knowing about for other cases.
You can certainly add a shortcut to a file. Because of security concerns
about attachments, an HTML message body with an <a> link pointing to a
file:// hyperlink would be my choice.

Now that sounds like a clever solution. How would I set the body of the
message in code ? I don't know if it's relevant, but this is an
appointment item, not a mail message. I couldn't see any property that
would set this.

Failing HTML, how would I put a shortcut in the body from code ?

I'm using Office 97 if it makes any difference.

Thanx very much for all the help
 
S

Sue Mosher [MVP-Outlook]

If it's an appointment item, try somethign along the lines of:

Item.Body = "<file://\\server\share\filename.doc>"

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
A

Alan Silver

"Sue Mosher said:
If it's an appointment item, try somethign along the lines of:

Item.Body = "<file://\\server\share\filename.doc>"

Fantastic !! I never knew you could do that with the Body of an item.

Any way I can make it a link, but have it displayed as just the file
name ? Using the method above, the user sees the <file:// and > bits.

Thanx very much.
 
S

Sue Mosher [MVP-Outlook]

Not in an appointment item, which doesn't support HTML.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
A

Alan Silver

"Sue Mosher said:
Not in an appointment item, which doesn't support HTML.

OK, what I have is certainly better than what I had before, so I'm not
complaining ;-)

Thanx again for all the help
 

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