Re: Copy a paragraph style from template to document
- From: Russ <drsN0SPAMmikle@xxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 14 Aug 2007 13:13:08 -0400
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.INVALIDThanks 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
.
- Follow-Ups:
- Re: Copy a paragraph style from template to document
- From: Stefan Blom
- Re: Copy a paragraph style from template to document
- References:
- Copy a paragraph style from template to document
- From: Jacqui
- Re: Copy a paragraph style from template to document
- From: Russ
- Re: Copy a paragraph style from template to document
- From: Jacqui
- Re: Copy a paragraph style from template to document
- From: Stefan Blom
- Re: Copy a paragraph style from template to document
- From: Jacqui
- Re: Copy a paragraph style from template to document
- From: Stefan Blom
- Re: Copy a paragraph style from template to document
- From: Jacqui
- Copy a paragraph style from template to document
- Prev by Date: #REF! = 0
- Next by Date: Re: Finding user-defined toobars
- Previous by thread: Re: Copy a paragraph style from template to document
- Next by thread: Re: Copy a paragraph style from template to document
- Index(es):
Relevant Pages
|