ShaunBurke3
New Member
- Joined
- Dec 9, 2023
- Messages
- 1
- Office Version
- 365
- Platform
- Windows
Hello, I've created a macro that generates a word document. There are certain lines in the code that I want bolded and indented in the word document when it is generated. I cannot find the VBA code to do that. Any thoughts? I have added a screenshot of the basic structure of what the word document would look like
A
VBA Code:
Dim objDoc
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Add
With objWord
.Visible = True
.Activate
.Selection.TypeText ("Good morning, Everyone!")
.Selection.TypeParagraph
.Selection.TypeText ("[Enter Narrative Here]")
.Selection.TypeParagraph
.Selection.TypeText ("Here is the status of the queues for ")
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(4, 2).Text)
.Selection.TypeParagraph
.Selection.TypeParagraph
.Selection.TypeText ("We have a total of ")
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(5, 2).Text)
.Selection.TypeText (" in queues.")
.Selection.TypeText (" There are ")
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(6, 2).Text)
.Selection.TypeText (" new tickets, ")
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(7, 2).Text)
.Selection.TypeText (" Assigned Tickets, ")
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(8, 2).Text)
.Selection.TypeText (" SMS tickets, and ")
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(9, 2).Text)
.Selection.TypeText (" Open Message tickets.")
.Selection.TypeParagraph
.Selection.TypeText ("The number of AAG tickets is ")
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(10, 2).Text)
.Selection.TypeParagraph
.Selection.TypeText ("[Enter Narrative Here]")
.Selection.TypeParagraph
.Selection.TypeText ("There are ")
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(11, 2).Text)
.Selection.TypeText (" unassigned text tickets.")
.Selection.TypeParagraph
.Selection.TypeText ("[Enter Narrative Here]")
.Selection.TypeParagraph
.Selection.TypeText ("There are ")
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(12, 2).Text)
.Selection.TypeText (" open messaging tickets in the queue")
.Selection.TypeParagraph
.Selection.TypeText ("[Enter Narrative Here]")
.Selection.TypeParagraph
.Selection.TypeParagraph
.Selection.TypeText ("4 Hour Queue:")
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(13, 2).Text)
.Selection.TypeText (" total tickets")
.Selection.TypeText ("1 Business day:")
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(14, 2).Text)
.Selection.TypeText (" total tickets")
.Selection.TypeParagraph
.Selection.TypeText ("[Enter Narrative Here]")
.Selection.TypeParagraph
.Selection.TypeParagraph
.Selection.TypeText ("The goal for today is [Enter Narrative Here]")
.Selection.TypeParagraph
.Selection.TypeParagraph
.Selection.TypeText ("Phone volume is 'x' for the day - coming in at ")
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(15, 2).Text)
.Selection.TypeText ("/per hour")
.Selection.TypeParagraph
.Selection.TypeText ("[Enter Narrative Here about incoming volume]")
.Selection.TypeParagraph
.Selection.TypeText ("Current average wait time is ")
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(16, 2).Text)
.Selection.TypeText (" seconds.")
.Selection.TypeParagraph
.Selection.TypeText ("[Enter Narrative Here about thin spots for the day]")
.Selection.TypeParagraph
.Selection.TypeParagraph
.Selection.TypeText ("Email volume is 'x' for the day - coming in at ")
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(17, 2).Text)
.Selection.TypeText ("/per hour incoming, ")
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(18, 2).Text)
.Selection.TypeText (" solve ")
.Selection.TypeParagraph
.Selection.TypeText ("[Enter Narrative Here about solves]")
.Selection.TypeParagraph
.Selection.TypeText ("[Enter Narrative Here about progress during the morning]")
.Selection.TypeParagraph
.Selection.TypeText ("[Enter Narrative Here about Assembled projectiosn about backlog]")
.Selection.TypeParagraph
.Selection.TypeParagraph
.Selection.TypeText ("Messaging is seeing 'x' volume")
.Selection.TypeParagraph
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(19, 2).Text)
.Selection.TypeText (" solved messaging tickets, ")
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(20, 2).Text)
.Selection.TypeText (" chats rated good, ")
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(21, 2).Text)
.Selection.TypeText (" chats rated bad")
.Selection.TypeParagraph
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(22, 2).Text)
.Selection.TypeParagraph
.Selection.TypeText ("[Narrative about messaging]")
.Selection.TypeParagraph
.Selection.TypeParagraph
.Selection.TypeText ("[Narrative about scheduling update]")
.Selection.TypeParagraph
.Selection.TypeText ("Returns to flip: ")
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(23, 2).Text)
.Selection.TypeText ("total")
.Selection.TypeText ("OMS / Orderhub Updates")
.Selection.TypeParagraph
.Selection.TypeText ("[Enter Narrative Here]")
.Selection.TypeParagraph
.Selection.TypeText ("Individuals out for th eday:")
.Selection.TypeText (ThisWorkbook.Sheets("Report").Cells(24, 2).Text)
.Selection.TypeParagraph
.Selection.TypeText ("[Enter narrative about reassigning queues]")
.Selection.TypeParagraph
.Selection.TypeParagraph
.Selection.TypeText ("Everyone have a great day!")
End With
End Sub