none
Font changing on its own RRS feed

  • Question

  • I have documents that we are changing the cover page. When I run my macro to replace the cover page its changing my font from Arial to Calibri all by its self. My original document and new cover page is all set in Arial so I don’t know where this Calibri is coming from. Here is the section in my macro that I copy and paste in the new cover page.

     

    ChangeFileOpenDirectory "U:\Test\"

    Documents.Open FileName:="U:\Test\Procedure Master 2010 Cover Page.docm", _

        ConfirmConversions:=False, ReadOnly:=True, AddToRecentFiles:=False, _

        PasswordDocument:="", PasswordTemplate:="", Revert:=False, _

        WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _

        wdOpenFormatAuto, XMLTransform:=""

    Selection.WholeStory

    Selection.Copy

    ActiveDocument.Close

    Selection.PasteAndFormat (wdPasteDefault)

    Monday, October 31, 2011 4:42 PM

Answers

  • I found my error. It was later in my macro. I had the following:

    AddIns.Add FileName:="U:\Test\Procedure Master 2010.dotm", Install:=True
    With ActiveDocument
        .UpdateStylesOnOpen = True
        .AttachedTemplate = "Normal"
        .XMLSchemaReferences.AutomaticValidation = True
        .XMLSchemaReferences.AllowSaveAsXMLWithoutValidation = False
    End With

    and it should be this:

    AddIns.Add FileName:="U:\Test\Procedure Master 2010.dotm", Install:=True
    With ActiveDocument
        .UpdateStylesOnOpen = True
        .AttachedTemplate = "Procedure Master 2010.dotm"
        .XMLSchemaReferences.AutomaticValidation = True
        .XMLSchemaReferences.AllowSaveAsXMLWithoutValidation = False
    End With

     

    • Marked as answer by fuzzhead58 Monday, October 31, 2011 4:51 PM
    Monday, October 31, 2011 4:51 PM