![]() |
|
#1
|
||||
|
||||
![]() It looks like you are using late binding to Word in which case you need to use the numeric equivalents of all the Word specific commands e.g. Code:
Private Sub CommandButton1_Click() Dim MSWord As Object Dim Datei As String Dim pdfName As String Set MSWord = CreateObject("Word.Application") MSWord.Visible = True Datei = "D:\WordTest.doc" pdfName = "D:\WordTest.pdf" MSWord.Documents.Add With MSWord.Selection .Font.Name = "Helvetica" .Font.Size = 20 .Font.Color = 255 .Font.Bold = True .Font.Italic = True .TypeText Text:="Text" .TypeParagraph End With MSWord.ActiveDocument.SaveAs Datei MSWord.ActiveDocument.ExportAsFixedFormat _ OutputFileName:=pdfName, _ ExportFormat:=17, _ OpenAfterExport:=False, _ OptimizeFor:=0, _ Range:=0, _ Item:=0, _ IncludeDocProps:=False, _ KeepIRM:=True, _ CreateBookmarks:=0, _ DocStructureTags:=True, _ BitmapMissingFonts:=True, _ UseISO19005_1:=False MSWord.ActiveDocument.Close MSWord.Quit Set MSWord = Nothing End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#2
|
|||
|
|||
![]()
Hi again,
your reply was very helpful. It's working out very nicely now. ... |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
tonytonytony | Excel | 3 | 03-10-2016 04:18 PM |
![]() |
kareemva | Excel Programming | 5 | 02-16-2016 12:10 AM |
![]() |
winwell | OneNote | 1 | 11-03-2015 12:19 PM |
sending data from UserForm of existing excel file to a new excel file | saltlakebuffalo | Excel Programming | 0 | 02-13-2014 10:55 PM |
![]() |
tomlam | Excel Programming | 4 | 10-01-2013 03:06 PM |