Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-05-2017, 06:50 AM
mchlbaudet mchlbaudet is offline Getting PDF File name from Table Windows 10 Getting PDF File name from Table Office 2016
Novice
Getting PDF File name from Table
 
Join Date: Dec 2017
Posts: 1
mchlbaudet is on a distinguished road
Default Getting PDF File name from Table

Hi,

I'm printing a word file as PDF but i want to get the filename from:

Table 1


Colum 2
Row 6

How can i add this code into this vba code:

ActivePrinter = "Microsoft Print to PDF"
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentWithMarkup, Copies:=1, Pages:="", PageType:= _
wdPrintAllPages, Collate:=True, Background:=True, PrintToFile:=False, _
PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0

If you have another way to save as pdf that's fine for me. I only want to have the name of the document as standard. People need to get the possibility to change the directory as long as it gets the filename from the cell mentioned above.
Reply With Quote
  #2  
Old 12-05-2017, 01:19 PM
macropod's Avatar
macropod macropod is offline Getting PDF File name from Table Windows 7 64bit Getting PDF File name from Table Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Since you want to be able to change the save folder, you could use something as simple as:
Code:
Sub Demo()
Dim StrNm As String
StrNm = Split(ActiveDocument.Tables(1).Cell(1, 1).Range.Text, vbCr)(0)
With Application.Dialogs(wdDialogFileSaveAs)
  .Name = StrNm
  .Format = wdFormatPDF
  .Show
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting PDF File name from Table Macro to convert table to convert table into iCalendar file? Weboh Word VBA 5 12-10-2016 03:07 PM
Getting PDF File name from Table Mailmerge to a table from a txt file troy23 Mail Merge 7 01-29-2014 04:40 AM
Getting PDF File name from Table putting image file into a cell of a table hklein Word VBA 1 04-19-2013 03:34 AM
A Table of Contents that Will Dictate the Content of the File ddhardy Word 0 06-23-2010 06:01 AM
Getting PDF File name from Table extracting data from Table to text file Anirudh_Dsp Word Tables 1 05-23-2010 07:48 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:13 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft