dear all
i have doc with 50 pages letter in one, i want to separate all pages and want to save in PDF each file individually path: C:\Users\adeel\Desktop\PDF
and file name should be company name which is top on each sheet..!
Adeel
dear all
i have doc with 50 pages letter in one, i want to separate all pages and want to save in PDF each file individually path: C:\Users\adeel\Desktop\PDF
and file name should be company name which is top on each sheet..!
Adeel
Last edited by adeel1; 02-23-2017 at 04:40 AM.
Hi
for as long as every company name is preceded by "To," and a paragraph, this should work
Please Login or Register to view this content.
dear nick
when i run the code showing error "this is not valid filename", pl look into
Adeel
Last edited by adeel1; 02-24-2017 at 04:40 AM.
Hi Adeel
That's probably because the file name is not acceptable, or the directory is not properly specified.
Is this the correct path for the directory to save the files into:
C:\Users\adeel\Desktop\PDF\
if so, did the macro copy some files into this directory, or did it hit the error on the first one?
Dear Nick
lot of thanks, now its working, i just copy and pasted the code actually there was space in mention path...!!great work sir
Adeel
Dear Nick
just facing one problem that i added header and footer and make some changing in paragraph,after that code is not working showing error again that - Run time error'-2147467259 (800054005) "this is not valid filename"
Adeel
Last edited by adeel1; 02-24-2017 at 10:44 AM.
Hi
There now appears to be a space after the “To, “ so the search and replace was not finding the company name. This is the most complex part of the macro and likely to be quite unstable, because it relies on finding the characters “To,” and selecting the text in the line below to identify the company name. If you have the companies’ names in a separate file – for example, a word table for a mail merge or an excel spreadsheet – it might be better to use this to identify the company names, not the letters themselves.
Another weakness in this format is that it assumes each page contains a single separate letter. If any of your letters are more than a page, it will only export the first page.
I have tweaked the macro to make it more stable. It is now ignoring the space after the “To, “. I have also modified it to print every page, regardless of the document length, and to check for illegal file names.
Several of your company names include characters that cannot be used in a file name, most commonly “ / “. When it encounters one of these, the macro should now present you with an input box to enter a legitimate file name. I suggest you delete the “ / “ in this instance.
Best wishes
Nicky
Please Login or Register to view this content.
Dear Nick
lot of thanks for help sir, this is great, absolutely great work
really appreciate your knowledge skill and patience, thanks
Adeel
Cross-posted at: http://www.msofficeforums.com/word-v...ate-sheet.html
Please read the Cross-Posting policy in rule #8: http://www.excelforum.com/forum-rule...rum-rules.html
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks