-
Open excel from Word and word file path+file to excel.
Hello,
I am a newbie at vba and i would like your help.
I have this doc file locked from editing with currently has a macro to email(i am able to add codes to it). I would like to add a code to open an excel and send current word file path and file name to excel when click on button "SEND FORM". With the excel file, it open THAT doc file (each doc file will have same date template but different file name/path base on client name or date so i cannot use static path) and extract data from that doc to excel.
Right now i would like to know how i can have word open excel and send file path to excel. i would try to code the excel after. Thanks in advanced.
Example. c:\user\02-16-17\word.doc (vba to open excel_extract.xls when click on button "SEND FORM")
c:\template\excel_extract.xls (vba to THAT word doc that was just close, the path and name will different for each file)
Note: the doc file has legacy "text form field" that is locked from have bookmark.
Current code --START--
Private Sub cmdSend1_Click()
Dim PauseTime, Start
Options.SendMailAttach = True
With ActiveDocument
.SendMail
PauseTime = 3
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
SendKeys "email address", True
End With
End Sub
--END--
Last edited by guest00x; 02-17-2017 at 12:40 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules