How can I see the vb code of an UI made Publisher template - vba

I'm using a publisher document as a template to create fitting instructions for our products. Everytime we launch a new product an individual instruction is produced which involves a lot of copy and pasting and then translating the master document into 4 different languages.
Although being individual to the product, there are only 5 sets of instructions with their own wordings (which doesn't change) and pics, the layout of the document is the same across all 5.
I was thinking to create a user form to enter the product name, choose the required set, insert photos and save the new doc as .pub and .pdf (only in English, I want to get this running first)
I tried around with Access and mail merge but it doesn't work the way I need it to. So I reverted to using VB in publisher where I've been basically able to return the text boxes, however, I can't see a way to display the code of the entire document with all text boxes and their formatting. Is this possible or would I have to code the entire document from scratch?
Thanks for reading and your input.

Related

Where best to store a version number in Word document?

I have a VSTO Add-In that fills a specific Word template document with data from a third party software. The trick here is that some changes in the script are connected to changes in the document. What I want to do now is to manually store some kind of version number in the document information so I can check in the script if the version of the document fits the version of the script.
I already took a look here but there are too many possibilities and I don't just want to pick any random object. I need to store it somewhere where it doesn't get changed.
Where would you recommend to store such a value?
edit: the version number has to be set manually because not every change of the document affects the script.
You have three options:
Document property - can be displayed in a document by using a DocProperty field but can be viewed and easily changed by the user.
Document variable - an old school method but still valid. Can be displayed in a document by using a DocVariable field but can only be added, or the value changed, by using code.
Custom XML Part - can be displayed in a document by mapping to a content control which can allow the value to be changed by the user. If not mapped can only be changed using code, but not as simply as a document variable.

Automating Split, Save Name and Error Checking with Acrobat Action Scripts?

I'm considering convincing my company to upgrade to Acrobat Pro so I can automate the processing of my scanned documents. Before I bring it up, I want to make sure the things I want to do are possible. I don't need anyone to give me the code, I just want to know if this is possible.
The documents i'm working with are landscape, 2-5 pages, and have the filename and page numbers in the footer. I want to scan a big stack of them and have a script perform the following actions:
Use OCR to acquire the filename and page numbers for each page. I would like to restrict the OCR to only look at the footer to save time and RAM.
Using the filenames, I want it to detect when one document ends and the next one begins so they can be split into separate files.
Before saving the split files, check that the number of pages in the file matches the page total in the footer. (I work in a factory and the documents can get sticky, so my scanner frequently pulls two pages at once)
Instead of saving the files where the page total doesn't match, compile a list of the errors so I know which documents need to be rescanned.
Finally, save all correct documents with their filenames from the footer to a folder on my desktop.
This could save me hours a week, so I'm hopeful that it's all possible. Thanks

Data Merge adobe indesign scripting from unique identifier

Currently I have a document with a rough layout for a catalog that I have developed. However, I would like to try and make it as quick as possible.
I have master pages for each section, and each page is different as you can tell from the image below.
The info id like to pull is an image from a folder, the price, the written section and the bullet points. the codes are highlighted as you can tell.
I was wondering: is there a way, preferably through Adobe scripting and data merge, to get data on each page from either a server or csv document where the user has input a variable(in the red box). It would be kind of like one would do on a html page where you enter a code/unique identifier in a textbox. then the rest of that section populates the data in that textbox.
Is there a way to do it without a 3rd party application that will cost an arm and a leg. If so are there any links that could help explain how this is done.

Smart/Fillable PDF adding more attributes

I am creating a Smart/Fillable PDF using Acrobat Pro DC.
I created a word file with 250+ fields(in a tabular manner), exported to PDF and then in "Prepare form" options I added checkboxes, dropdowns and a couple of buttons and the form is ready. Now I want to add 50+ more fields into that PDF but if i follow the same procedure export to PDF and then "Prepare form" then i shall loose all the old validations and scripts I have written initially.
To overcome this scenario I tried a couple of things that didn't work for me:
Go to "Edit PDF" option and try editing PDF but that did not work as that option helps editing text and images but I have fields in a tabular format so in case if I want to add a table with N x N fields not possible
Tried to copy all elements including textbox,checkbox,dropdowns buttons etc but cannot copy all at once, tried then in a small group like 15-15 and that worked but still I had to reposition so not a feasible way
Tried to export the elements including textbox,checkbox,dropdowns buttons etc but Acrobat Pro DC doesn't help
Many other manipulative things but didn't help.
Please help me to overcome this problem.
Thanks in advance.
If you change the background of the form, you would first open the old version, and then replace the pages with the ones from the new version. This does not affect any form fields, so, only some repositioning may be necessary.
Then you go to the form edit mode (or use the Select Object Tool (single key accelerator R)) and you can select the fields you want to copy and either drag-copy if you are on the same page, copy/paste them, or duplicate them on other pages (via Context menu of the selected field in edit mode).
Another potentially important hint: deactivate Save as… optimizes for fast web view when working with forms.

Locking text fields in embedded document

I have been tasked with updating a spreadsheet that produces a report by replacing text in a template. Previously, the worksheet referenced an outside/separate file-- my job is to get it working in an embedded document.
I currently have text form fields for every input I want to insert within the embedded document template. As it stands, users can edit the document template however they like, but if they accidentally erase a text form field (again, where text is replaced via the vba macro) then it will break the macro and the spreadsheet will be useless.
My question:
Is there some way to lock or protect text form fields such that the rest of the document is editable? I essentially want to have the inverse of a "text form field only" protection.
Alternatively, is there a better way to approach this project? I'm thinking of leaving the spreadsheet as is, but including a "reset" button bringing the template back to it's original state if anything breaks. If I did this method, this would require there NOT to be an external file. Attempts to do this so far have proven unsuccessful.
My general methodology/algorithm goes as follows:
Open the reference document
Replace all the text form fields via bookmarks with plain text,
making sure to reassign the bookmarks afterward (so as to not lose
them if they run the macro more than once).
Save the embedded document as a .doc with the inputs inserted
Replace all bookmarked inputs with text form fields to return the
template to its original state
Any information would be IMMENSELY appreciated. I am slowly running out of time and am feeling stuck.
Many thanks!
-Sooji