Re: Copy a paragraph style from template to document

Tech-Archive recommends: Fix windows errors by optimizing your registry



Jacqui,
Sorry it took you so long to figure this out, but if you had looked at my
original message more closely, you would have noticed that I had substituted
ActiveDocument.FullName in the code. I should have mentioned that, but I was
I trying to get out a quick message. I didn't test it, but it made sense
because the original code had the full path.

On Aug 14, 1:24 pm, "Stefan Blom" <no.s...@xxxxxxxxxx> wrote:
What happens when you try? Is there an error message? Does it work if you
try Destination:=ActiveDocument.FullName instead?

--
Stefan Blom
Microsoft Word MVP

"Jacqui" wrote in message

news:1187090482.125934.176430@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx



On Aug 14, 11:34 am, "Stefan Blom" <no.s...@xxxxxxxxxx> wrote:
Have you tried using Destination:=ActiveDocument.Name ?

--
Stefan Blom
Microsoft Word MVP

"Jacqui" wrote in message

news:1187086644.608909.312250@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

On Aug 14, 9:53 am, Russ <drsN0SPAMmi...@xxxxxxxxxxxxxxxxxxxxx> wrote:
Jacqui,

Record a macro while using the Word Organizer to do what you want and
the
relevant code will look something like this:

Application.OrganizerCopy Source:= _
"MyFullPathToOfficeStuff\Microsoft User Data\Normal",
Destination:=ActiveDocument.FullName _
, Name:= _
"MyStyle", Object:=wdOrganizerObjectStyles

I am trying to write a macro which will copy a particular paragraph
style from my normal.dot to the active document. I've trawled
through
the posts but can only find one which copies all styles, which I
don't
particularly want to do. Can anyone help?

thanks

--
Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID
Thanks for coming back to me Russ -

I tried that and here's the code I got:
Sub CopyDefinitionPara()
'
' CopyDefinitionPara Macro
' Macro recorded 14/08/2007 by Jacqueline Fulton
'
With ActiveDocument
.UpdateStylesOnOpen = False
.AttachedTemplate = "Normal"
End With
Application.OrganizerCopy Source:="C:\template\normal.dot",
Destination:= _
"F:\JF\Documents to be reformatted\Shop lease -
precedent.doc", Name:= _
"Definition Para", Object:=wdOrganizerObjectStyles
End Sub

This copies the style to this particular document but I want to be
able to run it in any document and the style is copied to the Active
Document - so I want to replace the destination doc name bit with
whatever I need for Active document (tried changing it to
ActiveDocument - but that didn't work either)- Hide quoted text -

- Show quoted text -

Yes I tried that also. I did again when I saw your message and here's
my code
ub CopyDefinitionPara()
'
' CopyDefinitionPara Macro
' Macro recorded 14/08/2007 by Jacqueline Fulton
'
With ActiveDocument
.UpdateStylesOnOpen = False
.AttachedTemplate = "Normal"
End With
Application.OrganizerCopy Source:="C:\template\normal.dot",
Destination:=ActiveDocument.Name, Name:= _
"Definition Para", Object:=wdOrganizerObjectStyles
End Sub

It still doesn't work - this is driving me nuts!- Hide quoted text -

- Show quoted text -

Just tried it with Full.Name and it worked! Thanks Stefan


--
Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

.



Relevant Pages

  • Re: Copy a paragraph style from template to document
    ... "Jacqui" wrote in message ... style from my normal.dot to the active document. ... ' CopyDefinitionPara Macro ... ActiveDocument - but that didn't work either)- Hide quoted text - ...
    (microsoft.public.word.vba.general)
  • Re: Copy a paragraph style from template to document
    ... Stefan Blom ... style from my normal.dot to the active document. ... ' CopyDefinitionPara Macro ... ActiveDocument - but that didn't work either)- Hide quoted text - ...
    (microsoft.public.word.vba.general)
  • Re: Copy a paragraph style from template to document
    ... relevant code will look something like this: ... style from my normal.dot to the active document. ... ' CopyDefinitionPara Macro ... ActiveDocument - but that didn't work either)- Hide quoted text - ...
    (microsoft.public.word.vba.general)
  • Re: Make checkbox on user form pass a character to active document
    ... With ActiveDocument ... If a checkbox on a userform is checked, ... What does "passed to bookmark the active document" ... if True, make a checkmark IN the document, presumably at a bookmark? ...
    (microsoft.public.word.vba.general)