Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Feb 2004
    Location
    Chicago, Illinois, USA
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am trying to copy specific styles from a template into an open document using the OrgzanizerCopy command. The code works fine for documents that are not being opened from DM. I can get it to work with DM files if I enter the path before ActiveDocument.Name where the file is located when it open, which is C:\Documents and Settings\zzl\Application Data\Hummingbird\DM\Temp\.

    I can't find a way to have this path automatically be recognized. Has anyone worked with this command and DM5 documents?

    strThisDocument = ActiveDocument.Name

    Application.OrganizerCopy Source:= _
    "v:\OfficeXP\Tempform\Styles.dot", _
    Destination:=strThisDocument, Name:="P2-DS Flush Left", _
    Object:=wdOrganizerObjectStyles

    Thanks.

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Can you use the full current path to the file --

    Code:
    strThisDocument = ActiveDocument.FullName
    -- or do you need to substitute the server path for the local path?

    Or is the problem that the path is not the correct path? (I guess I'm a bit confused.)

  3. #3
    New Lounger
    Join Date
    Feb 2004
    Location
    Chicago, Illinois, USA
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='jscher2000' post='761960' date='26-Feb-09 20:02']Can you use the full current path to the file --

    Code:
    strThisDocument = ActiveDocument.FullName
    -- or do you need to substitute the server path for the local path?

    Or is the problem that the path is not the correct path? (I guess I'm a bit confused.)[/quote]


    It gives me an ::ODMA path. So I think that's the problem because with DM5 the file gets moved from the server to that directory on C. I'm trying to not overwrite some of Word's built-in styles such as Heading 1, Heading 2, etc. So if I can't get this working my plan is to have a message box appear to not run my macro on files that have already been numbered using these styles.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •