Consulting

Results 1 to 2 of 2

Thread: Help on looping macro code and not repeating myself

  1. #1

    Help on looping macro code and not repeating myself

    I am working on the following macro code, but I have to constantly repeat myself because I don't know an easier way. Can someone please look at this code and help me. I would really appreciate the help! I have been going at this for weeks, and I can't find a solution.


    ' FILE NAME = LoQUo_01_01_d
    ActiveDocument.SaveAs2 FileName:="LoQUo_01_01_d.iim", FileFormat:= _
    wdFormatText, LockComments:=False, Password:="", AddToRecentFiles:=True, _
    WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
    SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
    False, Encoding:=msoEncodingUTF8, InsertLineBreaks:=False, AllowSubstitutions:=False _
    , LineEnding:=wdCRLF, CompatibilityMode:=0

    ' NEXT MACROS
    ActiveDocument.MailMerge.DataSource.ActiveRecord = wdNextRecord

    ' FILE NAME = LoQUo_01_02_d
    ActiveDocument.SaveAs2 FileName:="LoQUo_01_02_d.iim", FileFormat:= _
    wdFormatText, LockComments:=False, Password:="", AddToRecentFiles:=True, _
    WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
    SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
    False, Encoding:=msoEncodingUTF8, InsertLineBreaks:=False, AllowSubstitutions:=False _
    , LineEnding:=wdCRLF, CompatibilityMode:=0

    ' NEXT MACROS
    ActiveDocument.MailMerge.DataSource.ActiveRecord = wdNextRecord

    ' FILE NAME = LoQUo_02_01_d
    ActiveDocument.SaveAs2 FileName:="LoQUo_02_01_d.iim", FileFormat:= _
    wdFormatText, LockComments:=False, Password:="", AddToRecentFiles:=True, _
    WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
    SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
    False, Encoding:=msoEncodingUTF8, InsertLineBreaks:=False, AllowSubstitutions:=False _
    , LineEnding:=wdCRLF, CompatibilityMode:=0

    ' NEXT MACROS
    ActiveDocument.MailMerge.DataSource.ActiveRecord = wdNextRecord

    ' FILE NAME = LoQUo_02_02_d
    ActiveDocument.SaveAs2 FileName:="LoQUo_02_02_d.iim", FileFormat:= _
    wdFormatText, LockComments:=False, Password:="", AddToRecentFiles:=True, _
    WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
    SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
    False, Encoding:=msoEncodingUTF8, InsertLineBreaks:=False, AllowSubstitutions:=False _
    , LineEnding:=wdCRLF, CompatibilityMode:=0

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Cross-posted at: http://www.excelforum.com/word-progr...ml#post3706981
    For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

Posting Permissions

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