#1
|
|||
|
|||
Insert PDF into Word
Hi,
I have a Word Doc that I want to insert a PDF into. I already know how to do this by going to Insert and then Object. This is not what I want though. I want it to work like the SmartArt function works for pictures (Have a set size for the image and when you click on it you will be prompted to open a PDF). Is there a way to have something similar happen for PDF's? The only reason I want to be able to do this is to create a template for people to click the box and easily be able to insert the PDF. There are some non-tech people that would be using this and it would make it much easier for them. Thanks for your help! |
#2
|
||||
|
||||
Insert|Object is as simple as it gets. That said, if you insert the PDF object as an icon, double-clicking on it will open it in your pdf reader. Inserting it without the icon option means you can only insert the first page of however much of the pdf will fit on the current page.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Yes I know that it is an easy process, but I want to be able to have a formatted section that a user can click on and it will open the file explorer so they can pick a PDF and it will be placed in the formatted section. This will ensue all PDF's are placed with the same borders and such. All the PDF's that would need to be placed would be one page only. If there is a way to do this by an excel function or some sort of VBA coding I would like to know because so far in my research I have not found anything.
Thanks! |
#4
|
||||
|
||||
An Excel function? I thought you wanted to insert the PDF into Word? If you put a macrobutton field where you want the PDF. The size of the PDF will be determined by the distance between the margins at that point.
{ MACROBUTTON InsertPDF Click to select and insert PDF file } and double click that field to run the InsertPDF macro below, it will insert the selected PDF at the field location Code:
Sub InsertPDF() 'Graham Mayor - http://www.gmayor.com - Last updated - 04/03/2017 Dim strPDF As String Dim oRng As Range Set oRng = Selection.Range strPDF = BrowseForFile If Not strPDF = vbNullString Then oRng.Text = "" ActiveDocument.InlineShapes.AddOLEObject _ ClassType:="AcroExch.Document.DC", _ FileName:=strPDF, _ LinkToFile:=False, _ DisplayAsIcon:=False, _ Range:=oRng End If lbl_Exit: Exit Sub End Sub Private Function BrowseForFile() As String 'Graham Mayor - http://www.gmayor.com - Last updated - 04/03/2017 Dim fDialog As FileDialog On Error GoTo Err_Handler Set fDialog = Application.FileDialog(msoFileDialogFilePicker) With fDialog .Title = "Select the document to insert" .AllowMultiSelect = False .Filters.Clear .Filters.Add "PDF Format", "*.pdf" .InitialView = msoFileDialogViewTiles If .Show <> -1 Then GoTo Err_Handler: BrowseForFile = fDialog.SelectedItems.Item(1) End With lbl_Exit: Exit Function Err_Handler: BrowseForFile = vbNullString Resume lbl_Exit End Function
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
Tags |
insert, pdf |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I insert pictures directly into picture boxes by clicking the box instead of using INSERT>PIC | Bree | Word | 1 | 06-24-2016 10:32 PM |
Insert Captions and Word Wrap | TEAllred | Word | 1 | 11-22-2015 03:21 PM |
Is there anyway I can insert an easy bookmark in word? | BayhDole | Word | 2 | 07-21-2015 08:43 PM |
insert video into word doc | Wordstop | Word | 2 | 07-19-2013 07:01 AM |
how insert big word doc. into an email | tbklus | Word | 0 | 09-15-2010 01:07 PM |