Тёмный

Automate Mail Merge to Save Each Record Individually in MS Word | Step-By-Step Word VBA Tutorial 

Jie Jenn
Подписаться 63 тыс.
Просмотров 117 тыс.
50% 1

In this tutorial , we are going to learn how to 1) automate mail merge and 2) save each record as individual PDF or Word document (or any supported document type).
Mail Merge is a really useful feature built-in in Microsoft Word to create letters, labels, envelopes, or even drafting email in bulk. But not everything is perfect. One of the drawbacks with mail merge is that when you try to print each record as a single PDF file, unfortunately, Word combined all the records in one single PDF. Also, you cannot perform mail merge to save each record as their own individual Word document. By writing some VBA code, we can easily overcome the obstacle.
► VBA Source Code:
learndataanalysis.org/automat...
► Buy Me a Coffee? Your support is much appreciated!
-------------------------------------------------------------------------------------
☕ Paypal: www.paypal.me/jiejenn/5
☕ Venmo: @Jie-Jenn
💸 Join Robinhood with my link and we'll both get a free stock: join.robinhood.com/jiej6
► To learn how to password protect PDF (PDF encryption) files using VBA: • How to Password Protec...
► Support my channel so I can continue making free contents
---------------------------------------------------------------------------------------------------------------
🌳 Becoming a Patreon supporter: / jiejenn
🛒 By shopping on Amazon → amzn.to/2JkGeMD
🗓 Get updated on new Python videos → / madeinpython
📘 More tutorial videos on my website → LearnDataAnalysis.org
📺 Also check out my 2nd channel Excel channel focus on sharing Excel tips: bit.ly/3B1DjSA
✉ Business Inquiring: RU-vid@LearnDataAnalysis.org
Timestamp
00:00 Intro
06:48 Tutorial starts
#MailMerge #WordAutomation #WordMailMerge

Наука

Опубликовано:

 

6 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 261   
@jiejenn
@jiejenn 4 года назад
Want to add couple things here: 1) When your table header name contains a space, for example Account Name, because a data source field cannot have a space, VBA will automatically replace space with an underscore. So when you type your DataFields' name, instead of DataFields("Account Name").value, you want to use DataFields("Account_Name").value. 2) I will be working on a Mail Merge Utility with a UI with to eliminate the need to write VBA code. Also looking adding few useful features to enhance the functionality. 3) and try not use special characters in your file name. And lastly, thank you for all of your support and views. I appreciate it.
@nageshnagasubramanian1185
@nageshnagasubramanian1185 2 года назад
Jie Jenn, this was very useful. Can you tell how to few lines of code to combine 2 or more pdf files together in this script of yours?
@Ryangaming862
@Ryangaming862 4 года назад
I cannot thank enough for this tutorial, very useful and extremely helpful for someone like me. hours of work in minutes. thanks once again for sharing your knowledge :)
@Xaphoeous
@Xaphoeous 3 года назад
THANK YOU! This video, and especially the link to the VBA code, saved me hours and hours of work!
@jynxie88
@jynxie88 2 года назад
You are a lifesaver! There were some moments where I hit a roadblock, but meddled here and there and it saved my team's time, a LOT of it! Thank you so much sir.
@jiejenn
@jiejenn 2 года назад
Glad my video helped. Cheers.
@rachitnirmal
@rachitnirmal 4 года назад
You are savior! Thank you so much! This was smooth like anything!
@smithlithium06
@smithlithium06 3 года назад
You have saved me a lot of time! Thank you!
@ramanandkashyap5167
@ramanandkashyap5167 3 года назад
Woah!! This is awesome Jie. Thank you very much. Working perfectly fine.
@mistysword
@mistysword 5 лет назад
Thanks so much for all the effort! This saved my day
@nguyenthanhmy1702
@nguyenthanhmy1702 4 года назад
From Vietnam, thanks for sharing! It helps a lot
@maheshbabu2523
@maheshbabu2523 5 лет назад
Thanks so much Jie for all the effort.
@mauriciocovarrubias8255
@mauriciocovarrubias8255 3 года назад
Thanks a lot for sharing this wonderful tool. As a public server I need to send legal sheets with same info to different people and it works great! I dont have great knowledge of VBA but you made it so easy. At first I had troubles but with patiente I made it work. Greetings fro México.
@PURVESHPRAJAPATI-tm7ds
@PURVESHPRAJAPATI-tm7ds 2 года назад
Thanks. Jin. It is a very useful and timesaving clerical job which is widely used in corporates and other sectors. One my relative is in the HR department and he used to print and save the Increment / Bonus Letters individually by each employee and send by email to them. You can imagine how painful and time-consuming job for more than 500 employees. I shared this example and he is very happy to save his time by such Automation. Thanks Jin Again for your efforts.
@japurba
@japurba 4 года назад
This is great!! Thank you brother!
@user-wp3do2sz7f
@user-wp3do2sz7f Год назад
Thank You for a clean crisp code! It has provided me the solution in the first go!!!
@lucasm.s.6118
@lucasm.s.6118 4 года назад
Great tutorial. Thank you!!
@imranism
@imranism 4 года назад
This is amazing, It is a generic tool which can save each record from Excel in a customized pdf or word template.
@josephaggrey9972
@josephaggrey9972 4 года назад
This video is fantastic. It actually addressed what I was looking for. Great job. well done Jie.
@jiejenn
@jiejenn 4 года назад
Glad my video helped!
@ceciliaknights8306
@ceciliaknights8306 2 года назад
Dude!!! This worked so well!! You saved me hours of work, thank you so so much!
@soaresian
@soaresian 4 года назад
Thanks this is very helpful and simplified compared to all the complex threads out there.
@brianogutu723
@brianogutu723 4 года назад
Worked like a charm!Thanks alot
@selfreflections3066
@selfreflections3066 4 года назад
Thank You. Lots of blessings for you... This is so powerful.
@joanaamorfajardo3056
@joanaamorfajardo3056 2 года назад
This is very helpful. It helped me accomplish my task! Thank you so much!
@TOMRYANLUKE
@TOMRYANLUKE 3 года назад
THANK YOU FOR THIS!
@ihzaraki
@ihzaraki 3 года назад
Thank you so much, it's so easy to follow your step
@rayjohnfranco5171
@rayjohnfranco5171 3 года назад
Thank you so much!
@TatjanaKovalevica
@TatjanaKovalevica 4 года назад
thank you, very useful!
@MalinaC
@MalinaC 3 года назад
Awesome! Thank you!
@MrWarrentierney
@MrWarrentierney 4 года назад
Amazing! You are my hero!
@KSSiddhartha
@KSSiddhartha 3 года назад
Thank you very much!
@breodjebi
@breodjebi 3 года назад
This is awesome. Thank you very much. Working perfectly fine
@devenderrohilla
@devenderrohilla 4 года назад
Very nice...great way to explain and fully functional...thank you
@dhaval0071000
@dhaval0071000 4 года назад
mind blowing, superb knowledge you holding and speed of writing macros
@condee289
@condee289 4 года назад
Many thanks, it works.!!!
@chrislopez1414
@chrislopez1414 4 года назад
Genius!!! You are amazing !!!!!
@nelubadalan22
@nelubadalan22 4 года назад
Great job !
@dharmeshy3622
@dharmeshy3622 4 года назад
Thank you, its very useful for me
@nelsoncardona4910
@nelsoncardona4910 2 года назад
Thanks man!
@flagshipfleet
@flagshipfleet 4 года назад
So nice. Thank you very much
@kethanchordia
@kethanchordia 4 года назад
Amazing will save me a lot of time. Thank you. Subscribed for life :-)
@viveknakarmi3411
@viveknakarmi3411 2 года назад
You are a legend!!!Thanks for this.
@DarrylDevar
@DarrylDevar 3 года назад
Thank you, saved me a lot of time. Really appreciate this, nobody has a tutorial as detailed as yours. I also get a blank page at the end of every pdf with my first-page Header and Footer page included.
@jiejenn
@jiejenn 3 года назад
Check your document margin, could be there are some spaces extended outside the page.
@DarrylDevar
@DarrylDevar 3 года назад
@@jiejenn I still have the 1st page with my letterheads appearing on a blank page at the end, is there anyway of fixing this. Or printing only a certain number of pages so that i exclude the last empty page that appears.
@DarrylDevar
@DarrylDevar 3 года назад
Thank you, it was a spacing issue
@curlcurllocal
@curlcurllocal 3 года назад
This is fantastic thanks for sharing
@louiskudakwashemapanzure6121
@louiskudakwashemapanzure6121 5 лет назад
Thank you so much
@tameraziz2104
@tameraziz2104 3 года назад
Perfect, thank you so much..
@diratanaya4889
@diratanaya4889 4 года назад
Best trick, thanks very much
@suescherer5491
@suescherer5491 4 года назад
Thanks so much for the tutorial. Very clear. Can you provide the macro text pls.?
@melissaaguirre3193
@melissaaguirre3193 2 года назад
THANK YOU SO MUUUUUUUUUUCHHH FOR THIS!!!!
@jiejenn
@jiejenn 2 года назад
Glad my video helped.
@mcclusky21
@mcclusky21 4 года назад
This was a lifesaver thank you so much for this workaround!!! I had to watch a few times, but very easy to follow. Had to remove the SQLStatement though.
@YippeeKanYe
@YippeeKanYe 4 года назад
Same here, thank you Sharrod
@f.p.186
@f.p.186 4 года назад
@@YippeeKanYe i have a problem with that line as well, did you delete the sql statement after the comma or the whole line? (. Opendatasource name=....)
@YippeeKanYe
@YippeeKanYe 4 года назад
@@f.p.186 I deleted the whole line i.e. .Opendata...
@helifox
@helifox 2 года назад
Thank you very much, you save a lot of my time !!!
@jiejenn
@jiejenn 2 года назад
Glad my video helped.
@siddhesh4040
@siddhesh4040 4 года назад
Thank you so much.... :-)
@R0b3
@R0b3 3 года назад
Works great form me!!! Thanks a lot for your script. ;-)
@ghsskomal2458
@ghsskomal2458 Год назад
dear sir thank you for your tutorial
@YippeeKanYe
@YippeeKanYe 4 года назад
Hi Jie, Thank you for this video, very helpful. I have a question about formatting. The data that appears in the newly created word document does not have the proper formatting, i.e. Currency/Accounting/Percentage formatting in the excel file shows up as a general number in word. 6% would show up as 6.0 etc. Any ideas on how to fix this?
@JTPedersen
@JTPedersen 4 года назад
Greatly appreciate your sharing this. Struggled to find an effective solution elsewhere. Been awhile since I coded last. Your delivery was excellent and easy to replicate. Only real hiccup I had was the SQL code. SOURCE_FILE_PATH was correct (I set a Watch) yet stepping through the line, I'd consistently get the full filename path truncated (e.g. c:\1\2\3\file.xlsx, came back as c:\1\2\file.xlsx). Solution: Replace database$ with the name of the table containing the data in the xlsx. Worked beautifully. Thanks!
@jiejenn
@jiejenn 4 года назад
Glad my video helped.
@Prasadavajjhala
@Prasadavajjhala 3 года назад
legend :) thank you
@yogeshdesai3049
@yogeshdesai3049 4 года назад
Thanks its very helpful kindly share the another vdo for all records save in one pdf format
@m.khoerudin3816
@m.khoerudin3816 4 года назад
thanks, very usefull, but how if want to save with two DataFields, example, name and date
@9716367288
@9716367288 3 года назад
Omg..... Omg... Finaly i got vba code for mail merge for docx ans save file in docx... Thnk lost.... It very help full me.... 🙏🙏🙏
@andrewmarcou6164
@andrewmarcou6164 2 года назад
Hi, Awesome. Quick question, if my word document has a table of contents and I wish to update it is there VBA code to do so for each file?
@rajivraj6441
@rajivraj6441 Год назад
Thanks for the information, what if I want to save only 1 or 2 letters from the table and not the rest. How can this be done.
@rinarahmawati9472
@rinarahmawati9472 3 года назад
It's magic 😍
@viveksinghpratap
@viveksinghpratap 2 года назад
Hi Jie. This really helped me a lot while I used for some letters last year and I’m really thankful for that. However, while I’m trying the same code on a new file: 1. I’m getting separate files opened along with my letter format without any file name. 2. Both word and pdf files saved in my folder read as “word found licked fields during update. Word can’t update locked fields “ Kindly help. Thanks in advance
@ogechinnadozie7284
@ogechinnadozie7284 4 года назад
Thank you Jie Genn, the video explains all I'm looking for. I'm practically new with VBA Codes and I'm having a hard time understanding how you went about the "destination" which bears the mail merge automation. Could you do a little explanation on that? Thanks.
@jiejenn
@jiejenn 4 года назад
Not following your question. What do you mean by "destination"? Do you mean save your files in a different folder?
@ogechinnadozie7284
@ogechinnadozie7284 4 года назад
I meant the first line " folder_saved as string" the folder named "destination" I would like to know it's content and how to go about it? I know the second file is the Excel sheet containing the data. Can I work with an "xslm" file in this case
@santrisholawat5526
@santrisholawat5526 4 года назад
how to create with button of source_file & file save_as (dinamic path)? folder & filename picker
@eduardostewart412
@eduardostewart412 4 года назад
Thank you so much. Initially had blank pages, had to import and run the module from within the project/document section, not the normal section in the VBA editor tree window on the left screen (don't know proper name right now).
@johnvanco2959
@johnvanco2959 3 года назад
I have the same issue, what do you mean by running the module from within the project/document section ? Thanks for your help !
@eduardostewart412
@eduardostewart412 3 года назад
@@johnvanco2959 in the vba window tree on the left. It will list a generic version and a line for the document you have open that you want to run it in. Click on the actual doc and then run/press play
@csm191
@csm191 3 года назад
Thanks for posting your solution!
@feddyblade9908
@feddyblade9908 4 года назад
Is it possible to make pdf file output encrypted. Usually i do manual save as page 1, input password xxx, next save as page 2 input password yyy, and so on....
@ashishyadavhr
@ashishyadavhr 4 года назад
Thanks a lot for sharing this knowledge with us it was very useful. Please advise if we can separate individual documents from a mail merged consolidated file as well? can we use with the same method by making the source as that word file?
@jiejenn
@jiejenn 4 года назад
Well you can, but depends on the document content organization. Are the pages number consistent for each file? or the page number varies.
@capt336
@capt336 5 лет назад
Thank you for posting this video. The .Destination = WdSendtoNewDocument seems to make a long word file with every generated document from the Mail Merge put together. Any way how to change it so it just makes the one custom document for each line of source data?
@jiejenn
@jiejenn 5 лет назад
Not sure if it follow. Can you be more specific.
@kazisazzad9257
@kazisazzad9257 4 года назад
Hi, Many thanks for sharing this tutorial. It's amazing and so helpful. It's saving both in word and pdf format; is there any way to avoid saving in word format- please advise.
@jiejenn
@jiejenn 4 года назад
To avoid saving the word file, I think you can just comment out the line that saves the word file.
@dariotedesco8652
@dariotedesco8652 5 месяцев назад
thanks for your video. Unfortunately I have a problem when I run the code; a table will appear to confirm data source, I click on Show all and retreive my data source file choosing "Excel files ODBC (*xlsx), then I have the SelectTable window, I click on Options, Show, and I tick everything. I select the sheet where the specified column is, the window closes and then nothing happens. Do I maybe do something wrong? Thanks
@simonsylow1365
@simonsylow1365 2 года назад
Hello mate thank you so much for the toturtial! everything works however the documents crated seems to be all empty, can you help me with this problem?
@jiejenn
@jiejenn 2 года назад
Replied your email.
@catlovers776
@catlovers776 3 года назад
Hello sir this is super amazing, when I run the macro I’m getting run time error 5922. The error is showing up in line 10 where we have the open data source. Would you mind helping me out
@niloofarmaleki3573
@niloofarmaleki3573 4 года назад
Hello, Many thanks for the video. This was great! My question is In case I want this to be done only for a group of the rows, for example lets say on a column I have category 1,2 and 3, and I want to do this for category 3 only, how should I modify the VBA to apply the filter?
@jiejenn
@jiejenn 4 года назад
You can actually do that directly in a SQL statement. From the OpenDataSource statement, you can include what we called WHERE clause to include criteria. For example, assuming your column name is "Product Category" and you want to filter the dataset by label "category 1", you would write (noticing the extract double quotation): .OpenDataSource Name:=SOURCE_FILE_PATH, sqlstatement:="SELECT * FROM [$] WHERE [Product Category] IN (""Category 1"")"
@niloofarmaleki3573
@niloofarmaleki3573 4 года назад
@@jiejenn Many Thanks But actually when I add this where clause, nothing happens... I sent you a video on your email, would you please kindly check?
@chandrasekaranp8485
@chandrasekaranp8485 5 лет назад
Thanks you so much for your effort. Its helped me lot.
@robertanderson9915
@robertanderson9915 2 года назад
After the OpenDataSource instruction, I get a pop-up which allows me to select the whole worksheet, but then .DataSource.RecordCount = -1. Any ideas why it is not finding my records? Mail merge works normally so I'm sure the source data is ok.
@Master-dh3xl
@Master-dh3xl 3 года назад
Well done! but I have question with the sql statement if want to retrieve data from row 2 to row 10 how can I do with it? .OpenDataSource Name:=SOURCE_FILE_PATH, sqlstatement:="SELECT * FROM [databases$]" Thanks you.
@blogieblogger
@blogieblogger 5 лет назад
Hi JJ, I getting a 'Microsoft Data Link Error' which reads as 'Test connection failed because of an error in initializing provider. Cannot start your application. The workgroup information file is missing or opened exclusively by another user'. while I have not opened the excel file nor it is being used/accessed by anyother program. Please help.
@ngrant8822
@ngrant8822 4 года назад
Great video Jie Jenn, I have been struggling with the SaveAs2 comment. My Datafield has a '" | " character in the value, I want to save the file name as the 10 characters before the " | " character, can you help me?
@jiejenn
@jiejenn 4 года назад
| is one of the characters cannot be used to create a file or folder name. You will have to use other characters that is valid.
@ScottAlexander68
@ScottAlexander68 3 года назад
This is great and it works perfectly. I am wanting to expand on it a bit by selecting the records from the Excel file that have not been "processed" yet. I have that figured out, but I am trying to figure out how to update the excel field to show it as processed so the next time I run the macro, it doesn't pick that record. For example, I want to change the Processed field from No to Yes. Hopefully you understand what I am trying to do.
@jiejenn
@jiejenn 3 года назад
If you want to process rows based on a condition(s), after the loop, you can insert an IF statement to express your criteria. For example, if your field is called "Processed", the code would look something like IF .fieldname("Processed").value = "Yes" THEN [mail merge code block] END
@ScottAlexander68
@ScottAlexander68 3 года назад
@@jiejenn I figured that part out after some trial and error. But what I want it to do is after it finds the records and creates the new documents, update the row in Excel so it does not have a duplicate made. For example, say I have 10 rows and I have a "Processed" column. 4 of the 10 rows have No in this column and 6 have Yes. The query finds the 4 rows that were not processed, your script creates the PDF, but I want those rows to change the No to Yes so next time I run the script, these rows will not be created again. Hope that makes sense.
@jiejenn
@jiejenn 3 года назад
@@ScottAlexander68 I think I understood your question fully now. If you want to update cells in Excel, it involves of adding Excel reference in Word VBA, which is a bit more advanced if you do not have experience in writing VBA. I will take this as an idea and to make a part 2 video in the future.
@ScottAlexander68
@ScottAlexander68 3 года назад
@@jiejenn Don't have much experience at all. That would be great and I am going to do some reading too lol.
@bloodshotsoul
@bloodshotsoul 3 года назад
What if you have multiple letters for the same person? Could a file contain multiple letters for the same person?
@undrawingend
@undrawingend 2 года назад
Is it possible to have this make individual folders for each database reference and then have the files save in them locations ? Just out of interest as used this for batch documents in work and it’s been great however it requires moving said file into a folder for each individual letter any advice?
@jiejenn
@jiejenn 2 года назад
Yeah, it is possible.
@stuartsharp8071
@stuartsharp8071 4 года назад
Good tutorial, although not sure what I have done wrong. Managed to take a 49 page (49 individual letters) mail merged document and end up with 49 versions of the same each with the 49 pages each, instead of 49 documents with a letter each.
@mauriciocovarrubias8255
@mauriciocovarrubias8255 3 года назад
Happened the same to me. Any solution?
@lrgamage88
@lrgamage88 3 года назад
how to custom add starting and ending record?
@Stonium
@Stonium 3 года назад
I love you.
@nullhas
@nullhas 4 года назад
Hi Jenn, Pls advise, how to select rows to merge. I do not want to delete previous data.
@Permik123
@Permik123 4 года назад
After you have connected to your database file on the Word Ribon choose edit recipient list. This is the Microsoft article on the subject. support.office.com/en-us/article/mail-merge-using-an-excel-spreadsheet-858c7d7f-5cc0-4ba1-9a7b-0a948fa3d7d3
@npaverico
@npaverico 4 года назад
What a great tutorial!! I have one question. I need to put a repeated name in the file name. For example "Approval - Project" . The word Approval has to be in all my file names. How do I include the in the macros?
@jiejenn
@jiejenn 4 года назад
Within the TargetDoc.SaveAs2 you can concat any addition text you want to include. For example: TargetDoc.SaveAs2 FOLDER_SAVED & .DataSource.DataFields("Client_Name").value & " Approval - Project" & ".docx"
@hestertencate2980
@hestertencate2980 2 года назад
@@jiejenn can you also do any additional text infront of the name? what would be the code? I've been trying but no idea...
@tomdenapoli5313
@tomdenapoli5313 3 года назад
Will this work on a Mac (Office 16). So far, no love.
@missyg3183
@missyg3183 5 лет назад
hi, thank you for this, i have a question - i keep getting a debugger error on the open source data line. i see your folder is in C drive, i have to use a W drive - is that the issue? also i get a pop up asking me to select a workbook. any suggestions would be really helpful. thank you!
@jiejenn
@jiejenn 5 лет назад
I don't think drive location should matter, but your error to me seems like Word cannot find the file. The pop up is caused by Word doesn't have the source file linked. If you want, you can send me your VBA code to youtube@learndataanalysis.org and I can take a look at it.
@StuartHough
@StuartHough 5 лет назад
same issue here
@StuartHough
@StuartHough 5 лет назад
I fixed this by unselecting the 'preview results' option in word. It then worked fine!
@keithng6480
@keithng6480 4 года назад
Hi! Great tutorial and helped me greatly. However, the macro seems to create an extra empty file after its done with everything... any way for me to correct this?
@jiejenn
@jiejenn 4 года назад
If you want, you can send me your Word file and your Excel data file to RU-vid@LearnDataAnalysis.org and I can take a look.
@jeremybautista5100
@jeremybautista5100 4 года назад
@@jiejenn Hi was this solved? I am having the same issue
@jeremybautista5100
@jeremybautista5100 4 года назад
Sorry not the same issue its just all the merges are just blank
@MrMarho
@MrMarho 4 года назад
Nice tutorial! I have some questions though. What if you already have a conditional statement (like skip record if mergefield Field_name is ""). This means the loop will still try to run the total number of records. What is the workaround? Can be filename also be dynamic? i.e. a function of text Manipulation?
@jiejenn
@jiejenn 4 года назад
Give me an example.
@MrMarho
@MrMarho 4 года назад
@@jiejenn Let's say from Excel you have 2 fields; Name and DOB. Now when doing mailmerge in Word, you put a conditional saying skip record if DOB = "". Also In Excel, the Name field is a combination of Title, Fname, Mname, and Lname from an original database. So your name field in excel will come as "Miss Jane A. Doe" or "Mr. John Doe" if there's no Mname. This means when you do mailmerge you have just two fields name and DOB in word. From your tutorial, the code will go through the total number of records and save as .docx or export to .pdf regardless of what is in the field. This means it will even do a merge for empty fields as far as you have set up your mergefields in word as you would like them to be outputted. So this is what I would like to do, use pagecount to know the number of pages it needs to loop through OR use and IF statement in the VBA code to know what records to actually save indiviudual documents for. It will also extract just the first and last name from each record.
@lashadolenjashvili9775
@lashadolenjashvili9775 4 года назад
Hey Jie Jenn, thanks for this tutorial. I am trying to do the same with Publisher, but I can't figure out what to do. Could you please somehow look at my code and give me an advice?
@jiejenn
@jiejenn 4 года назад
Do you mean Windows publisher?
@lashadolenjashvili9775
@lashadolenjashvili9775 4 года назад
@@jiejenn I am very glad you answered. Yes, Microsoft Publisher. I have Mail Merge, it is connected to excel sheet. And I want to convert each record to separate PDF. I wrote a simple script, it generates PDFs with correct names, but for some reason each PDF contains only the second record from excel.
@julianspb6329
@julianspb6329 5 лет назад
Hello, Thank you very much for the video. When i try to run the code, a tab saying "select table" show ups and when i click okay it say that "Run-time error '5922' unable to find data source". Do you know what i am doing wrong? Thanks
@jiejenn
@jiejenn 5 лет назад
Check your code to see if there are any typos.
@parniunplugged7023
@parniunplugged7023 4 года назад
@@jiejenn I also got same error. Its something to do with SQL Statement.
@abdulwahedcatran8349
@abdulwahedcatran8349 5 лет назад
Thank you so much please how to add a picture to the file
@jiejenn
@jiejenn 5 лет назад
I'm not following your question.
@abdulwahedcatran8349
@abdulwahedcatran8349 5 лет назад
@@jiejenn Let's say we have a logo folder for each client and we want to put this image on the customer's message
@tsang9413
@tsang9413 4 года назад
Thanks. This is very useful & I can successfully try even I don't have any IT knowledge. Thanks so much!! And would like to ask if it is possible to set a password in the PDF??
@jiejenn
@jiejenn 4 года назад
VBA Save function doesn't have set password option. You might have to use 3rd party software to automatically set PDF files' password.
@tsang9413
@tsang9413 4 года назад
@@jiejenn Thanks a lot^^
@michaelfaw
@michaelfaw 4 года назад
I do follow the step that you give. But why the result is blank document and pdf? any idea about this issue?
@jiejenn
@jiejenn 4 года назад
Without looking at your code, your file, and the error you get, it is nearly impossible to help. I would suggest you post your question on Microsoft Word Forum.
@UpYours101
@UpYours101 5 лет назад
Any tips on how to implement this with a variable list. Eg product1, product2 (if exists), ... ?
@jiejenn
@jiejenn 5 лет назад
Never thought of that before. This is interesting, let me experiment a little bit and will get back to you.
@jiejenn
@jiejenn 5 лет назад
Hey there, I think I figured it out but cause give me a specific example.
@UpYours101
@UpYours101 5 лет назад
@@jiejenn So for example: account 1 - has stock AAA valued @100; account 2 has AAA @150, BBB @ 300, CCC @ 250; account 3; has AAA, BBB, CCC, DDD, EEE, FFF; account 4 has AAA, BBB, DDD, ... ZZZ
@91alezander
@91alezander 4 года назад
It is possible to generate a word template from every excel row individually. In excel I need a button to appear on every new row I populate with data and the button must open the word template that was fill with the data that I populate the row. And also i need the autofill word template to be save in a specified location. Thank you!
@jiejenn
@jiejenn 4 года назад
Yeah it is doable, but because you want to tie each row per button, you will have to manually re-link the button to each row. It is a pretty time consuming process if you have many records though.
@91alezander
@91alezander 4 года назад
@@jiejenn Thank you!
@zarinamustapha8604
@zarinamustapha8604 4 года назад
Hi, Thanks for the tutorial. It doesn't work when I followed it on a Mac, quite possibly something is different between the two platforms. The macro ran, no error, but no files have been created. I'm not an expert in VB, though
@jiejenn
@jiejenn 4 года назад
Hi Zarina, I think the object references are a little bit different on Mac. Unfortunately I am not a Mac user nor do I own a Mac PC. Your best bet is look for someone who has a Windows PC and try the mail merge and see if it works.
@romellamarie5608
@romellamarie5608 4 года назад
@@jiejenn i have the same problem with Zarina, and I'm running Windows. help?
@romellamarie5608
@romellamarie5608 4 года назад
i.m using word 2013 .. is there a different?
@danwilson4860
@danwilson4860 3 года назад
I have had the same difficulties. I was able to get the script to MOSTLY work though. Line 19: The 1 to TotalRecord doesn't seem to work, but if you replace TotalRecord with the actual total number of records then it works. Line 33: I cannot get it to save PDFs. If I comment out this line, the script will create unique word files for every merge record, but my Mac chokes on wdExportFormatPDF
@fongkaichian9073
@fongkaichian9073 10 месяцев назад
Facing a problem that once merge and the doc / PDF was empty but the PFD file name was correct, any idea?
@jiejenn
@jiejenn 10 месяцев назад
Makes sure your PDF content is extractable. If it is an image or encrypted, then it may not work.
@kamiwasielewski1119
@kamiwasielewski1119 Год назад
Hi, I am able to produce word and PDF but both file are empty ) no words insite. Can someone help.
Далее
Наташа Кампуш. 3096 дней в плену.
00:58
Symmetrical face⁉️🤔 #beauty
00:15
Просмотров 3,6 млн
Mail Merge from Excel to Microsoft Word
15:03
Просмотров 2,5 млн
Using Mail Merge in Word VBA | Pt. 1
21:49
Просмотров 10 тыс.
How to Mail Merge using Power Automate
20:22
Просмотров 273 тыс.
5 Things I wish I knew When I started using Excel VBA
12:45
Using Mail Merge in Word VBA | Pt. 2
22:08
Просмотров 3,2 тыс.