Automation: Organizer vs SharePoint

J

joelfinkle

I'm having a problem with using the OrganizerCopy method ability to copy
styles from from one document to another, when the destination document is
opened off a SharePoint server.

The problem is that Word lies.

When you ask Word what file is open (ActiveDocument.FullName), it says
http://moss.mycompany.com/sites/mysite/Project Documents/1/GTest.doc

but if you record a macro that copies styles using Word's Organizer function
the file it's working on is labeled
C:\Documents and Settings\username\Local Settings\Temporary Internet
Files\Content.MSO\8405E896.doc
which is the temporary file that Word uses to work on the web-based document.
This is unpleasant, to say the least.

Is there any method or property that will tell me the "real" (cached)
location of the SharePoint document that the recorded macro uses? Having the
code record a macro then parsing it out of the recorded macro is not a
reasonable solution.

notes:
1) the document I'm copying from is not a SharePoint doc, but that shouldn't
matter
2) Using ActiveDocument.Name doesn't help either
 
C

Cindy M.

Hi =?Utf-8?B?am9lbGZpbmtsZQ==?=,
Is there any method or property that will tell me the "real" (cached)
location of the SharePoint document that the recorded macro uses? Having the
code record a macro then parsing it out of the recorded macro is not a
reasonable solution.
I don't understand why you should need to work with the macro recorder beyond
learning the basic syntax required?

Use FullName to populate a string variable, then work that into the
OrganizerCopy code. Roughly:

Dim sDestinationFile as String
Dim sSourceFile as String

sDestinationFile = ActiveDocument.FullName
sSourceFile = "C:\xyz\source.doc"
OrganizerCopy sSourceFile, sDestinationFile, _
"styleName", wdOrganizerObjectStyles


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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