- Introdução
- Tutoriais
- Projetos de automação
- Criando automações
- Noções básicas de automação
- Repo. de Objetos
- Melhores Práticas de Automação
- Tutorial: Criando uma Tabela Pivot
- Tutorial: Iterando através das Linhas de uma Tabela
- Tutorial: Comparar arquivos do Excel e enviar e-mails com erros de reconciliação
- Tutorial: Extrair dados de e-mails automatizados e movê-los para um aplicativo da área de trabalho.
- Tutorial: Filtrar dados no Excel
- Tutorial: Formatar células
- Tutorial: Adicionar informações sobre os arquivos de uma pasta para um arquivo do Excel
- Tutorial: Adicionando suas Próprias Fórmulas ao Project Notebook
- Tutorial: Trabalhar com a automação do Word
- Automação do PowerPoint
- Automação de dados
- Atividades comuns
- Automação do Google Workspace
- Automação do OneDrive e do SharePoint
- Solução de problemas
Guia do usuário do StudioX
Neste tutorial, criaremos uma automação que gera um documento do Word para revisão do desempenho individual de cada membro de uma equipe, com base em um modelo de arquivo do Word e dados coletados de vários arquivos do Excel e de texto. O modelo de arquivo contém texto de espaço reservado e indicadores, que podem ser preenchidos com valores usando atividades do Word. Os nomes dos arquivos do Excel e de texto dos quais os dados serão copiados seguem um padrão específico que inclui o nome do funcionário.
Começaremos adicionando uma atividade Use Excel File para indicar um arquivo do Excel com informação do funcionário para adicionar à automação. Dentro dele, adicionaremos uma atividade For Each Excel Row para iterar através das linhas com dados de funcionários. Dentro de cada linha do Excel, adicionaremos uma atividade Use Word File para adicionar o documento modelo à automação e, em seguida, uma série de atividades Replace Text, Set Bookmark Content e Insert DataTable in Document preencherá cada arquivo do Word com as informações necessárias extraídos para cada funcionário de um arquivo do Excel e um arquivo de texto. Por fim, adicionaremos uma atividade Save Word File As para salvar o modelo de documento como um arquivo separado para cada funcionário.
- Configure o projeto e obtenha os arquivos necessários.
- Crie um novo projeto em branco usando as configurações padrão.
- Baixe e extraia o arquivo com o projeto de automação neste tutorial usando o botão na parte inferior desta página. Copie a pasta Arquivos para a pasta do seu projeto.
- Crie uma pasta chamada Saída na pasta do seu projeto.
- Adicionar o Excel com os dados do funcionário ao projeto e iterar pelas linhas do arquivo.
- In StudioX, click Add Activity
in the Designer panel, and then find the Use Excel File activity in the search box at the top of the screen and select it. The activity is added to the Designer panel. - Na atividade:
-
Click Browse
next to the Excel file field, and then browse to the Files folder and select the file Employees.xlsx. -
No campo Referenciar como, insira
EmployeeData.Você indicou que trabalhará com o arquivo Employees.xlsx que é conhecido em sua automação como EmployeeData.
-
- Click Add Activity
inside Use Excel File, and then find the For Each Excel Row activity in the search box at the top of the screen and select it. The activity is added to the Designer panel inside the Use Excel File activity. - Na atividade For Each Excel Row:
-
Na caixa de texto Para cada, substitua
CurrentRowporEmployee. -
Click Plus
on the right side of the In range field, and then select EmployeeData > Sheet1 [Sheet].Você indicou que deseja iterar por todas as linhas da Sheet1 da planilha Employees. Como cada linha contém informações sobre um funcionário, a linha atual na iteração foi renomeada como Funcionário para tornar as informações da linha mais fáceis de identificar posteriormente na automação.
-
- In StudioX, click Add Activity
- Adicionar o arquivo de modelo do Word à automação.
- Click Add Activity
inside For Each Excel Row, and then find the Use Word File activity in the search box at the top of the screen and select it. The activity is added to the Designer panel. - Na atividade Use Word File:
-
Click Browse
next to the Word file field, and then browse to the Files folder and select the file PerformanceReviewDoc_template.docx. -
Desmarque a caixa de seleção Salvar alterações. Isso garante que o modelo de arquivo não seja salvo com os dados adicionados para cada funcionário.
Você indicou que trabalhará com o arquivo modelo_DocAvaliaçãodeDesempenho.
-
- Click Add Activity
- Adicionar informações do arquivo do Excel com os dados do funcionário ao arquivo do Word.
- Click Add Activity
inside Use Word File, and then find the Replace Text activity in the search box at the top of the screen and select it. The activity is added to the Designer panel. - Na atividade Replace Text:
-
Click Plus
on the right side of the Search for field, and then select Text. In the Text Builder, enter <>. -
Click Plus
on the right side of the Replace with field, and then select Employee > Full Name.Você indicou que deseja substituir o texto do placeholder <
> no arquivo do Word com o nome completo que é copiado para cada funcionário da célula na coluna Nome completo do arquivo do Excel Funcionários.
-
- Click Add Activity
below the Replace Text activity, and then find the Set Bookmark Content activity in the search box at the top of the screen and select it. The activity is added to the Designer panel. - Na atividade Set Bookmark Content:
-
Click Plus
on the right side of the Bookmark name field, and then select Text. In the Text Builder, enter DirectManager. -
Click Plus
on the right side of the Bookmark text field, and then select Employee > Direct Manager.Você indicou que, para cada funcionário, deseja adicionar o nome do gerente direto ao arquivo Word, copiando o conteúdo da célula na coluna Gerente Direto do arquivo Excel Funcionários e colando-o no local do marcador GerenteDireto no arquivo do Word.
-
- Repita as etapas 3 a 4 três vezes para adicionar atividades Set Bookmark Content adicionais, que adicionam o nome completo, localização e cargo de cada funcionário ao arquivo do Word. Configure cada atividade da seguinte maneira:
-
Nome do indicador
FullName, Texto do indicador Funcionário > Nome completo -
Nome do indicador
Location, Nome do indicador Funcionário > Localização -
Nome do indicador
PositionTitle, Nome do indicador Funcionário > Título do cargo
-
- Click Add Activity
- Adicionar informação do arquivo Excel com dados sobre projetos ao arquivo do Word.
- Click Add Activity
below the last Set Bookmark Content, and then find the Use Excel File activity in the search box at the top of the screen and select it. The activity is added to the Designer panel. - Na atividade Use Excel File:
-
Click Plus
on the right side of the Excel file field, and then select Text.No Construtor de Texto:
-
Insira o texto
Files\ -
Click Plus
on the right side of the Text Builder, and then select Employee > Full Name. -
Insira o texto
_Projects.xlsxO texto deve ter a seguinte aparência:
Files\[Employee]FullName_Projects.xlsx. -
Click Save in the Text Builder.
Você indicou que, para cada funcionário, deseja adicionar o arquivo do Excel Projetos à automação. Como a seleção do Arquivo do Excel é um caminho de arquivo dinâmico e você deseja poder selecionar dados nas atividades que usam os arquivos de projetos, você indicou um dos arquivos como um modelo de arquivo.
-
-
- Click Add Activity
inside the newly added Use Excel File activity, and then find the Insert DataTable in Document activity in the search box at the top of the screen and select it. The activity is added to the Designer panel. - Na atividade Insert DataTable in Document:
-
Click Plus
on the right side of the Table to insert field, and then select Projects > Sheet1 [Sheet] > Table1 [Table]. -
No Inserir relativo a do menu suspenso, selecione Indicador.
-
Click Plus
on the right side of the Bookmark to search for field, and then select Text. In the Text Builder, enter Projects. -
No menu suspenso Posição onde inserir, selecione Depois.
Você indicou que, para cada funcionário, deseja copiar a Tabela1 do arquivo Excel de Projetos e colá-la no arquivo Word após o indicador denominado Projetos.
-
- Click Add Activity
- Adicionar informação dos arquivos de texto com feedback do gerente ao arquivo do Word e salve um arquivo separado para cada funcionário.
- Click Add Activity
below the newly added Use Excel File activity, and then find the Read Text File activity in the search box at the top of the screen and select it. The activity is added to the Designer panel. - Na atividade Read Text File:
-
Click Plus
on the right side of the Filename field, and then select Text.No Construtor de Texto:
-
Insira o texto
Files\ -
Click Plus
on the right side of the Text Builder, and then select Employee > Full Name. -
Insira o texto
_ManagerFeedback.txtO texto deve ter a seguinte aparência:
Files\[Employee]FullName_ManagerFeedback.txt. -
Click Save in the Text Builder.
-
-
In the Properties panel, click Plus
on the right side of the Output to field, and then select Open in Advanced Editor. Enter the expression Saved.Values(Of String)("ManagerFeedback")and click OK.Você indicou que, para cada funcionário, deseja copiar o feedback do gerente do arquivo de texto que contém o nome do funcionário no nome do arquivo e deseja salvar o feedback para uso posterior na automação.
-
- Click Add Activity
below the Read Text File activity, and then find the Set Bookmark Content activity in the search box at the top of the screen and select it. The activity is added to the Designer panel. - Na atividade Set Bookmark Content:
-
Click Plus
on the right side of the Bookmark name field, and then select Text. In the Text Builder, enter DirectManagerFeedback. -
Click Plus
on the right side of the Bookmark text field, and then select Use Saved Value > ManagerFeedback.Você indicou que, para cada funcionário, deseja copiar o feedback do gerente que salvou para uso posterior na atividade Read Text File e colá-lo no arquivo do Word no local do indicador DirectManagerFeedback.
-
- Click Add Activity
below the Set Bookmark Content activity, and then find the Save Word File As activity in the search box at the top of the screen and select it. The activity is added to the Designer panel. - Na atividade Save Word File As.
-
Click Plus
on the right side of the Save as file field, and then select Text.No Construtor de Texto:
-
Insira o texto
Output\ -
Click Plus
on the right side of the Text Builder, and then select Employee > Full Name. -
Insira o texto
_PerformanceReview.docxO texto deve ter a seguinte aparência:
Output\[Employee]FullName_PerformanceReview.docx. -
Click Save in the Text Builder.
-
-
Deixe as seleções padrão para as outras opções.
Você indicou que deseja salvar o arquivo de modelo modificado com os dados de cada funcionário em uma nova pasta chamada Saída. O nome completo de cada funcionário será adicionado ao nome do arquivo usando o valor na coluna Nome Completo do arquivo Funcionário do Excel
-
- Clique em Salvar na faixa de opções do StudioX para salvar a automação e clique em Executar para executar a automação. A automação cria documentos Word de revisão de desempenho separados para cada funcionário na pasta Saída e preenche os arquivos com informação dos arquivos do Excel com dados de funcionários e informação de projetos e dos arquivos de texto com feedback do gerente. Baixe o exemplo
- Click Add Activity