Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / July 2007

Tip: Looking for answers? Try searching our database.

appWord.OrganizerCopy error in word 2007

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Princess Fiona - 10 Jul 2007 16:50 GMT
Hi,
I am trying to create a template for a document. I would like to copy the
styles from the document to the template. In Word 2002 the following VBA-Code
works fine:
-----------------------------------------------------------------------------------------------
sSource = m_docSource.FullName
Set docTemplate = appWord.Documents.Open( _
               m_docSource.AttachedTemplate.FullName, _
               addtorecentfiles:=False, _
               Visible:=False)      
'Un-protect the template if protected (will not be protected when saved again)
If docTemplate.ProtectionType <> wdNoProtection Then
    docTemplate.Unprotect m_sPasswordForOpen
End If
sTarget = docTemplate.FullName

For Each stlSource In m_docSource.Styles
       If stlSource.InUse Then
           appWord.OrganizerCopy sSource, sTarget, stlSource.NameLocal,
wdOrganizerObjectStyles
       End If
   Next
-----------------------------------------------------------------------------------------------

In Word 2007 this code works fine also, but only if the ActiveDocument is
stored on the local filesystem.
If the source document is stored somewhere on a fileserver the code produces
a error on appWord.OrganizerCopy that tells you, that the sSource document
is already open.
The system seems to block itself.
I have also used a mapped drive to the file server but this did not work
either.
Does anybody know a solution, how to solve the problem?

Thanks for help.
Russ - 10 Jul 2007 21:11 GMT
Word 2007 may now be forcing people to only load templates locally.
Check out this message thread:
http://tinyurl.com/3yzhns

> Hi,
> I am trying to create a template for a document. I would like to copy the
[quoted text clipped - 33 lines]
>
> Thanks for help.

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.