- 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

StudioX user guide
Tutorial: Trabalhar com a automação do Word
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.
We will start by adding a Use Excel File activity to indicate an Excel file with employee information to add to the automation. Inside it, we will add a For Each Excel Row activity to iterate through the rows with employee data. Inside For Each Excel Row, we will add a Use Word File activity to add the template document to the automation, and then a series of Replace Text, Set Bookmark Content, and Insert DataTable in Document activities will populate each Word file with the necessary information taken for each employee from an Excel file and a text file. Finally, we will add a Save Word File As activity to save the template document as a separate file for each employee.
- Configure o projeto e obtenha os arquivos necessários.
- Create a new blank project using the default settings.
- 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. -
Clear the Save changes check box. This ensures that the template file is not saved with the data added for each employee.
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.You have indicated that you want to replace the placeholder text <
> in the Word file with the full name that is copied for each employee from the cell in the Full Name column of the Employees Excel file.
-
- 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
-
- Click Save in the StudioX ribbon to save the automation, then click Run to execute the automation.The automation creates separate performance review Word documents for each employee in the Output folder and populates the files with information from the Excel files with employee data and projects information, and from the text files with manager feedback. Download example
- Click Add Activity