Ir ao conteúdo
  • Cadastre-se

wesley.elias

Membro Júnior
  • Posts

    3
  • Cadastrado em

  • Última visita

Reputação

0
  1. @rosanezane Obrigado por responder. Eu fiz aqui e não deu certo. Eu preciso substituir o codigo que estou usando por esse ou acrescentar esse no final?
  2. Pessoal, estou usando o codigo abaixo para gerar pdf individuais, gerados por meio de uma mala direta. Contudo, preciso salvar os arquivos considerando o nome de um dos campos existentes, que no caso será o nome de um funcionário. alguém consegue me ajudar? Segue o codigo utilizado: Sub SaveAsSeparatePDFs() 'Updated by Extendoffice 20180906 Dim I As Long Dim xStr As String Dim xPathStr As Variant Dim xDictoryStr As String Dim xFileDlg As FileDialog Dim xStartPage, xEndPage As Long Dim xStartPageStr, xEndPageStr As String Set xFileDlg = Application.FileDialog(msoFileDialogFolderPicker) If xFileDlg.Show <> -1 Then MsgBox "Please chose a valid directory", vbInformation, "Kutools for Word" Exit Sub End If xPathStr = xFileDlg.SelectedItems(1) xStartPageStr = InputBox("Begin saving PDFs starting with page __? " & vbNewLine & "(ex: 1)", "Kutools for Word") xEndPageStr = InputBox("Save PDFs until page __?" & vbNewLine & "(ex: 7)", "Kutools for Word") If Not (IsNumeric(xStartPageStr) And IsNumeric(xEndPageStr)) Then MsgBox "The enterng start page and end page should be number format", vbInformation, "Kutools for Word" Exit Sub End If xStartPage = CInt(xStartPageStr) xEndPage = CInt(xEndPageStr) If xStartPage > xEndPage Then MsgBox "The start page number can't be larger than end page", vbInformation, "Kutools for Word" Exit Sub End If If xEndPage > ActiveDocument.BuiltInDocumentProperties(wdPropertyPages) Then xEndPage = ActiveDocument.BuiltInDocumentProperties(wdPropertyPages) End If For I = xStartPage To xEndPage ActiveDocument.ExportAsFixedFormat xPathStr & "\Page_" & I & ".pdf", _ wdExportFormatPDF, False, wdExportOptimizeForPrint, wdExportFromTo, I, I, wdExportDocumentWithMarkup, _ False, False, wdExportCreateHeadingBookmarks, True, False, False Next End Sub
  3. Prezados estou usando o código abaixo, mas preciso que os arquivos sejam salvos com o campo "Nome" que tem na mala direta. Esse campo refere-se ao nome de cada pessoa da mala direta. alguém pode me ajudar? Sub SaveAsSeparatePDFs() 'Updated by Extendoffice 20180906 Dim I As Long Dim xStr As String Dim xPathStr As Variant Dim xDictoryStr As String Dim xFileDlg As FileDialog Dim xStartPage, xEndPage As Long Dim xStartPageStr, xEndPageStr As String Set xFileDlg = Application.FileDialog(msoFileDialogFolderPicker) If xFileDlg.Show <> -1 Then MsgBox "Please chose a valid directory", vbInformation, "Kutools for Word" Exit Sub End If xPathStr = xFileDlg.SelectedItems(1) xStartPageStr = InputBox("Begin saving PDFs starting with page __? " & vbNewLine & "(ex: 1)", "Kutools for Word") xEndPageStr = InputBox("Save PDFs until page __?" & vbNewLine & "(ex: 7)", "Kutools for Word") If Not (IsNumeric(xStartPageStr) And IsNumeric(xEndPageStr)) Then MsgBox "The enterng start page and end page should be number format", vbInformation, "Kutools for Word" Exit Sub End If xStartPage = CInt(xStartPageStr) xEndPage = CInt(xEndPageStr) If xStartPage > xEndPage Then MsgBox "The start page number can't be larger than end page", vbInformation, "Kutools for Word" Exit Sub End If If xEndPage > ActiveDocument.BuiltInDocumentProperties(wdPropertyPages) Then xEndPage = ActiveDocument.BuiltInDocumentProperties(wdPropertyPages) End If For I = xStartPage To xEndPage ActiveDocument.ExportAsFixedFormat xPathStr & "\Page_" & I & ".pdf", _ wdExportFormatPDF, False, wdExportOptimizeForPrint, wdExportFromTo, I, I, wdExportDocumentWithMarkup, _ False, False, wdExportCreateHeadingBookmarks, True, False, False Next End Sub

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...

Ebook grátis: Aprenda a ler resistores e capacitores!

EBOOK GRÁTIS!

CLIQUE AQUI E BAIXE AGORA MESMO!