Email Word with Message (Uses xlDialogSendMail & Outlook Express)

Chia sẻ bởi:hands
★★★★★
Quảng cáo
Sub SaveAsNewFile()
    'set current doc name and path
    Dim docName As String: docName = ActiveDocument.Name
    Dim filepath As String: filepath = ActiveDocument.Path
'create a new file
    Documents.Add
'get the path of a current file
    ChangeFileOpenDirectory filepath
'insert content of current file to newly created doc
    Selection.InsertFile _
        FileName:=docName, _
        Range:="", _
        ConfirmConversions:=False, _
        Link:=False, _
        Attachment:=False
'open prompt to save a new file

'With Dialogs(wdDialogFileSaveAs)
    '    .Name = docName & "-copy"
    '    .Show
    'End With

ActiveDocument.SendMail
End Sub

stackoverflow.com/questions/21317885/using-vba-to-copy-the-contents-of-a-word-document-into-another-word-document

Khóa học Power PI – Ứng dung trong Nhân sự
Khóa học SprinGO phù hợp

Khóa học Power PI – Ứng dung trong Nhân sự

TỔNG QUAN KHÓA HỌC: POWER BI CHO NGÀNH NHÂN SỰ Khóa học Power BI cho Nhân sự được thiết kế dành riêng cho các...

Xem khóa học
★★★★★ 5 ★ 1 👤 1 ▥ 0
Quảng cáo

Bạn nên đọc

One Response

  1. hands says:

    Application.Dialogs (Word)

    Returns a [URL='www.codevba.com/Word/Dialogs.htm']Dialogs collection that represents all the built-in dialog boxes in Word.

    For information about returning a single member of a collection, see Returning an object from a collection. For a list of built-in dialog boxes, see the WdWordDialog enumeration.

    Dim dlgFind As Dialog
    
    Set dlgFind = Dialogs(wdDialogEditFind)
    
    With dlgFind
     .Find = "Hello"
     .Show
    End With

    http://www.codevba.com/Word/Application/Dialogs.htm

    http://www.google.com/search?q=Application.Dialogs+word+macro&rlz=1C1GCEU_viVN915VN915&oq=Application.Dialogs+word+macro&gs_lcrp=EgZjaHJvbWUyCQgAEEUYORigATIHCAEQIRigATIHCAIQIRigATIKCAMQIRgWGB0YHjIKCAQQIRgWGB0YHtIBCDQyNDlqMGo3qAIAsAIA&sourceid=chrome&ie=UTF-8

Leave a Reply

Your email address will not be published. Required fields are marked *

Quảng cáo

Cũ vẫn chất

Xem thêm