MS Word 2010 Copy Paste

Papi

Well-known Member
Joined
May 22, 2007
Messages
1,592
Likely not the place for such a topic but wondering where a person can find a site like MRExcel but one that deals with MS Word? Over the years I have keyed in areas of interest and hands down the one that I return to 95% of the time is MrExcel.

I'm stuck on a macro copy paste issue after data is imported from Excel into Word but need to know how one would get the file to save based on the last row which holds the filename but the recorded macro simply returns what it sees in the first file.
Code:
Sub Save_New()
'
'
    Selection.EndKey Unit:=wdStory
    Selection.MoveUp Unit:=wdLine, Count:=1
    Selection.HomeKey Unit:=wdLine
    Selection.EndKey Unit:=wdLine, Extend:=wdExtend
    
    Selection.Cut
    ChangeFileOpenDirectory _
        "C:\Documents\Backups\Thank You Letter\"
    ActiveDocument.SaveAs2 FileName:= _
        "Static Electric Inc. - Barry Henderson - 0726.docm", _
        FileFormat:=wdFormatXMLDocumentMacroEnabled, LockComments:=False, _
        Password:="", AddToRecentFiles:=True, WritePassword:="", _
        ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
        SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
        False, CompatibilityMode:=14
End Sub
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top