Graphics & Styles Conflict

R

RN

I have a figure composed of boxes with text. The problem is if I import it
into another document this text takes on the style of the new document. How
do I stop this. If this is done the text will not fit into the boxes and
becomes unreadable. I don't want to paste as a bitmap. Readability of this
method under of 2007 is poor.
 
K

Klaus Linke

RN said:
I have a figure composed of boxes with text. The problem is if I import
it
into another document this text takes on the style of the new document.
How do I stop this. If this is done the text will not fit into the boxes
and
becomes unreadable. I don't want to paste as a bitmap. Readability
of this method under of 2007 is poor.


Hi,

You could rename the style, either in the doc you paste into, or in the
document(s) you paste from.

Regards,
Klaus
 
R

RN

Thanks. I don't know how to do this and I did not create the original
document.
Do I modify normal?
 
K

Klaus Linke

RN said:
Thanks. I don't know how to do this and I did not create the original
document.
Do I modify normal?

Darn, should have expected that...
The built-in styles can't be renamed (easily), and most times it's the
"Normal" style that is giving grief.

I don't know a really simple solution.

If you have control over the document you paste into, you could start with
the document(s) you paste from (by using their template if available, or by
making a copy and deleting the content, or by using the organizer to copy
the styles).
Then in the new document avoid the Normal style, and use "Body Text" or
something else that you can modify as you want.
As long as the "Normal" style in the document is the same in both docs, text
in that style won't change as you copy/paste.

Another solution I've used, but which is a bit advanced, is to save in a
format in which you can edit the styles by hand (RTF, XML, HTML...), and
rename the styles directly in the stylesheet.
I've posted a macro that does that using the RTF format previously (see code
below).
I'd run it on the docs you paste from, and then work with the resulting RTF
files (which then contain the user-defined style "Normal*" instead of the
built-in style "Normal", so the formatting does not change if you paste from
there into a document with a differently defined "Normal" style).

The simplest solution in the end may be to copy/paste as you did, but then
to apply a properly defined paragraph style to the text boxes so that the
text fits.
Defining such a style -- with the font and size the text boxes had in the
document(s) you paste from -- isn't hard, and applying a dedicated style to
the text boxes is a good idea in any case, if they should have a different
font and/or size from the usual body text.

Regards,
Klaus


Sub ChangeStyleNames2()
' The macro appends a * to all style names
' It thus changes built-in styles to ordinary styles
Dim myRange As Range
Dim MsgText
Dim myFileName

MsgText = "Cancel if you have not saved the file"
If MsgBox(MsgText, vbExclamation + vbOKCancel, _
"Danger") = vbCancel Then
Exit Sub
End If

myFileName = ActiveDocument.Name
If InStr(1, myFileName, ".") > 0 Then
myFileName = left$(myFileName, _
InStr(1, myFileName, ".")) & "RTF"
Else
myFileName = myFileName & ".RTF"
End If
ActiveDocument.SaveAs _
FileName:=myFileName, _
FileFormat:=wdFormatRTF
ActiveDocument.Close

Documents.Open _
FileName:=myFileName, _
ConfirmConversions:=False, _
Format:=wdOpenFormatText
Set myRange = ActiveDocument.Content
myRange.Find.Execute _
FindText:="\{\\stylesheet*\}\}", _
MatchWildcards:=True
myRange.Find.Execute _
FindText:=";\}", _
ReplaceWith:="*^&", _
MatchWildcards:=True, _
Replace:=wdReplaceAll
ActiveDocument.Save
ActiveDocument.Close
Documents.Open _
FileName:=myFileName
End Sub
 

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