Hey all, I'm *really* fresh to VBA as a whole and have a *very* general concept of how to read the scripting
I've frankensteined together some code that mostly does what I need, but I'm having a formatting issue with one section of my code.
I'm sure it's a single line that I'm just not plugging in right, but I've tried a handful of different methods that I haven't been able to implement..
Here's the section that does everything I need except the center alignment:
Current Result:
I'm betting it's a matter of bad syntax but here's what I've plugged in so far:
Selection.PageSetup.CenterHorizontally = True
Selection.HorizontalAlignment = xlCenter
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
and the above-listed Rows.Alignment
Any help would be appreciated!
PS: Bonus points if you can teach how to keep it from deleting the email signature when it pastes
I've frankensteined together some code that mostly does what I need, but I'm having a formatting issue with one section of my code.
I'm sure it's a single line that I'm just not plugging in right, but I've tried a handful of different methods that I haven't been able to implement..
Here's the section that does everything I need except the center alignment:
VBA Code:
'Copy contents
Sheets("Tables").Select
Range("J6:R145").Select
Range("J6").Activate
Selection.Copy
'Open new mail item
Dim outlookApp As Object
Set outlookApp = CreateObject("Outlook.Application")
Set outMail = outlookApp.CreateItem(0)
'Get Word editor
outMail.Display
Dim wordDoc As Object
Set wordDoc = outMail.GetInspector.WordEditor
'Paste as image
wordDoc.Range.PasteAndFormat Type:=wdChartPicture
wordDoc.Range.Select
Selection.Rows.Alignment = wdAlignRowCenter
Current Result:
I'm betting it's a matter of bad syntax but here's what I've plugged in so far:
Selection.PageSetup.CenterHorizontally = True
Selection.HorizontalAlignment = xlCenter
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
and the above-listed Rows.Alignment
Any help would be appreciated!
PS: Bonus points if you can teach how to keep it from deleting the email signature when it pastes