PDF Snippets in Word Doc with VBA? - vba

So I have this Word doc with a bunch of ActiveX buttons, and whenever one of the buttons is pressed, a corresponding image pops up in a userform. It looks like this:
My problem is that each of the images that pops up is a screenshot of a portion of a PDF, but my users actually need to be able to select/copy the text presented.
Is there any good way to embed portions of a PDF file in a userform so that the text is select-able? It shouldn't be edit-able, just select-able.
Or, worst case scenario, what might be the easiest way to copy text from the PDF myself and format it onto a userform?
Thanks!

I wouldn't recommend using the image control for this if you want user to select the text from pdf.
Do this.
Install Adobe Pdf Reader on your pc.
Create a New Userform and place the AcroPDF1 and CommandButton control and you are done.
To Add the AcroPDF1 control see the screenshot
Next, draw the control on the Userform and place a CommandButton on the form
This is how your userform might look.
Put this code in the click event of the CommandButton1.
Option Explicit
Private Sub CommandButton1_Click()
'~~> Change filename as applicable
AcroPDF1.LoadFile "C:\Sample.Pdf"
End Sub
Now when you run it, the pdf will be displayed and you can select text. See screenshot below.

Related

VBA - Apply document formatting to open Word doc

I am using data in an Excel workbook to create an HTML string when a user clicks a button. I then use VBA to save that string as an .html file, open it in Word, and bring Word to the foreground. That all works great.
Now, I'd like to add a line(s) to the VBA to select the document formatting.
In the Word doc that opens, there's this in the ribbon:
When I hover over that formatting option, it's called "Lines (simple)." I can click it in Word, and it formats the text exactly how I want it. But, I'd like to do so automatically with the VBA over in Excel that created and launched the Word document. Unfortunately I just don't know which command or property that is and haven't been able to find it with searches or document inspection. I'd appreciate your help.

Copy & Paste the Selected text from the PDF File using AXAcroPDF in VB.NET

I have a windows form in VB.net having the following tools
Adobe pdf Reader(AxAcroPDF)
A Text box
Two Buttons
On Clicking the first button ,the pdf file selected using Open dialog box will appear on AxAcroPDF.
I Want to SELECT a desired text from the pdf shown and then to display this text to the text box(Copy & Paste Method) on the click event of the second button.
I cannot find the AxAcroPDF.Selectedtext property.I searched a lot and also tried to use iTextSharp to accomplish it.But failed.
Please Help !

VBA Powerpoint - find HIGHLIGHTED text in shape, then ADD a new text box with ANIMATION effect

I have this Powerpoint file. Here the link:
https://drive.google.com/open?id=1JaRrBDOEKkCnxeGHrynwdmhPtaOZ8Y4f
I have turned a MS Word file into Powerpoint file using the instruction in this video:
https://www.youtube.com/watch?v=7oao6EzF08U
after conversion
I want to unhighlight the text, then add a new text box (Red shape fill and Send behind text) with ANIMATION effect, put it in the position of the unhighlighted text like in the pictures.
unhighlight text
add new text box with animation effect
Therefore, I can show the correct answer to my students when teaching using PPT.
I have about 100 slides like this but I don't have enough time to do it all manually.
Unfortunately, MS Powerpoint doesn't have Macro Recorder like in MS Word and I also don't know much about VBA code.
Is there any way to use VBA code to solve this problem?
Thanks in advance.

save textbox as picture in powerpoint_transparancy difficulties

In powerpoint 2010 I want to save an inserted textbox as a picture, which is simply done by right-clicking on the text box and save it. The saved image will however include a large amount of transparancy around the text. I am wondering whether this abundance of transparency around the text can be reduced, whithout using photo-editing programs.
I understand that powerpoint is not the right tool to use the beautifuly created texts for other purposes aside from office itself, however this would make things ten times easier for some coworkers of mine.
I hope someone can help me with this, also if it means using VBA or other (complex) codes/languages.
Thnx for your time.
Mike
Once you have typed your text in the textbox,
Copy the text box, right-click and paste as image
Now you have the image of the text box as you will get while saving that textbox as image - - using the save_as_image option
Select this image and click on format tab
You have an option to crop your image
Crop the image and save it as a picture

How can I embed a PDF in a Word Doc, and access that PDF with VBA?

I have a word doc with some ActiveX buttons on it. When one of these buttons is pressed, a UserForm pops up with a corresponding PDF displayed, like so:
This is exactly the behavior I want. However, the problem is that for this to work, the user of the word doc needs to have each of the PDFs saved on their machine as well. Here's the code for one of the buttons:
Private Sub AC1Button_Click()
DisplayForm.AcroPDF1.LoadFile ("C:\Users\arose\Desktop\Security Control Doc\Sub PDFs\AC1.pdf")
DisplayForm.Show
End Sub
As you can see, the path is hardcoded in. I need to be able to distribute this word doc without needing to distribute a bunch of PDFs along with it, so is there any way to embed PDFs in a word document in such a way that they're accessible by VBA?
I've discovered here that it's reasonably easy to embed a PDF in any office doc. And I've tried that:
But I can't figure out how to access that PDF object in my VBA code, in order to display it on the UserForm.
Any insight is appreciated, thanks!
Embed the files (and display as icon to stop them taking over your document)
To activate the first OLE object in your document,
ThisDocument.InlineShapes(1).OLEFormat.Activate
is the command.