Outlook 2007 Calendar

Status
Not open for further replies.
You can do more lines by repeating the loop, with different values for Mobile Number:, but it will get messy fast. Will you be using the same red blue formatting for each line? If so, remove Mobile Number from the pattern - then anything with the pattern : something : something else: will be formatted red & blue.
.Pattern = "(:\s*(.*):\s*(.*)\n)"
 
Will try it. Nothing else to as whether its words or numbers. Correct?
 
This pattern:

> Pattern = "(:\s*(.*):\s*(.*)\n)"

looks for any character -that's what the (.*) part does. So it looks for any string between : and ending with a line break. So it will find anything, including junk like this:

Hey You: hehe 435hytg \\)}: hgt&^4db
 
"(:\s*(.*):\s*(.*)\n)"




So the concept is the s*(.*) searches for what is before it which is : and then does it twice. And if that is correct, what is the \n ?
 
The first s - \s* looks for spaces, the \n is new line, aka line break, EOL, line feed, or what you get when you hit Enter key. :)

The pattern is a colon space then any characters before another colon. Then more characters before a line break.
 
It works perfect...thanks so so much....however, that last thing to do is that the words before the first space is the title to each line....and those are just words that are in the If line for each field as you know...so is there a way to ad to the macro the font for the first words of each line and there are the same font and size and underlined, but color black.....so here are examples of the If lines and you can see a few title words but I don't won't to identify all the title words just a font macro for the begining before the first space

If ObjItem.GetInspector.ModifiedFormPages("General"). Controls("Company").Text <> "" Then strDynamicDL10 = strDynamicDL10 & ("Company Name: ") & strFullName & (": ") & strCompanyName & vbCrLf

If ObjItem.GetInspector.ModifiedFormPages("General"). Controls("ComboBox9").Text <> "" Then strDynamicDL15 = strDynamicDL15 & ("Last Status: ") & strFullName & (": ") & strLastStatus & vbCrLf

So it would look like the following:

Company Name: Mary Spring: Spring Services which the front words are the title....Mary is the name...and Spring Services is the name of the Company.....so want to font the first words Company Name: which would apply to all first words in each line.

Possible?​

 
To All If This Helps:

I read in another areas how under Microsoft Word, you can put in certain words in a Macro and that Macro fonts the words you put in the Macro.....so I tried it in a Word Document, it worked and then I moved it to Outlook using the normal additional lines to have Outlook recognize a macro from Microsoft Word.....so here is the Macro that you put in the names in the Array you want to font, and it does it, so the question now is how to use an array regarding a the words from a field of the contact?

Sub Variables_NormalTxt()

Dim oRng As Word.Range

Dim oRngFC As Word.Range

Dim varUbyteNormal As Variant

Dim ArrayItem As String

Dim i As Integer

Dim Document As Word.Document
Dim Word As Word.Application
Dim selection As Word.selection
Set Ins = Application.ActiveInspector
Set Document = Ins.WordEditor
Set Word = Document.Application
Set selection = Word.selection

varUbyteNormal = Array("Company Name:", "Full Name/", "Mobile Number:", "Business Number:", "Last Status:")

For i = 0 To UBound(varUbyteNormal)

selection.Find.Wrap = wdFindContinue

rp:
With selection.Find
.ClearFormatting
.MatchWholeWord = True
.MatchCase = False
If .Execute(varUbyteNormal(i)) Then

selection.Font.Name = "Times New Roman"
selection.Font.Color = Black
selection.Font.Bold = True
selection.Font.Size = 14
selection.Font.Underline = True
GoTo rp:
End If
End With

Next

End Sub
 
This part -
varUbyteNormal = Array("Company Name:", "Full Name/", "Mobile Number:", "Business Number:", "Last Status:")
For i = 0 To UBound(varUbyteNormal)

olSelection.Find.Wrap = wdFindContinue

rp:
With selection.Find
.ClearFormatting
.MatchWholeWord = True
.MatchCase = False
If .Execute(varUbyteNormal(i)) Then
selection.Font.Name = "Times New Roman"
selection.Font.Color = Black
selection.Font.Bold = True
selection.Font.Size = 14
selection.Font.Underline = True
GoTo rp:
End If
End With

would go in the macro, replacing the lines you use to clearformatting and do the find/replacement.
olSelection.Find.ClearFormatting
olSelection.Find.Replacement.ClearFormatting

(and more)
 
Thanks much. However I don't understand what you said. Sorry. Can you explain please?
 
You'll take this chunk of code that searches for the words and put it in your macro, replacing the code that searches for mobile number (if the macro still has that code). Make sure the variables match your code - you use olSelection, this sample uses selection. It can go before or after the code that finds the : and colors the names and numbers.

varUbyteNormal = Array("Company Name:", "Full Name/", "Mobile Number:", "Business Number:", "Last Status:")
For i = 0 To UBound(varUbyteNormal)
selection.Find.Wrap = wdFindContinue
rp:
With selection.Find
.ClearFormatting
.MatchWholeWord = True
.MatchCase = False
If .Execute(varUbyteNormal(i)) Then
selection.Font.Name = "Times New Roman"
selection.Font.Color = Black
selection.Font.Bold = True
selection.Font.Size = 14
selection.Font.Underline = True
GoTo rp:
End If
End With
Next
 
The code I showed at the top works perfectly to font the specific words that are in the Array.......so what I need to do if possible, is can this code be changed so it fonts what ever words come from a field of the contacts....for example can we font thru this code the strFullName or the ObjItem.FullName?
 
The code I showed at the top works perfectly to font the specific words that are in the Array.......so what I need to do if possible, is can this code be changed so it fonts what ever words come from a field of the contacts....for example can we font thru this code the strFullName or the ObjItem.FullName?
 
You might be able to do something like

strfullnameArray = strFullname & "," & strfullnameArray

if that doesn't work, use this to wrap the names with quotes -

strfullnameArray = chr(34) & strFullname & chr(34) & "," & strfullnameArray

then use

varUbyteNormal = Array(strfullnameArray)

and the rest of the code.

Or you could update the appointment as you read each contact, rather than create the string to write to the appointment. I'm not sure which way is more efficient.
 
I tried both and added the full code to the calender event code that shows the Fullname but did not do it. What else to fix maybe?
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
S outlook 2007 calendar search Using Outlook 6
S Outlook 2007 Calendar instant search problem. Windows 7 Using Outlook 4
S Outlook 2007 Calendar instant search problem. Windows 7 Using Outlook 0
S View Appointment in Text Wrap in Outlook 2007 Month Calendar View Using Outlook 0
R Outlook 2007 calendar colors Using Outlook 15
R Using Internet Calendar in Outlook 2007 within Citrix Using Outlook 1
F Outlook 2007 Calendar Appointments not in Outlook Today view Using Outlook 11
M calendar in outlook 2007 Using Outlook 1
M outlook 2007 calendar Using Outlook 2
J Outlook 2007 Error sharing Calendar: Error while preparing to send sharing message Using Outlook.com accounts in Outlook 2
P Outlook 2007 Calendar Ribbon has changed and I can't fix it Using Outlook 10
O Outlook Calendar 2007 - Invitation Times Using Outlook 19
K Outlook 2007 Calendar - Time spinner does not function correctly Using Outlook 1
V Setting up windows 7 & outlook 2007 w/ Iphone 4 & synch contacts & calendar Using Outlook 9
M sync Outlook 2007 calendar with icloud Using Outlook 1
B Outlook 2007 and Live Calendar Stopped Synching Using Outlook.com accounts in Outlook 4
A Change calendar permissions in Outlook 2007 Using Outlook 9
M Missing Calendar in Outlook 2007 Using Outlook 3
B cant accept iCal calendar invites in Outlook 2007 (SP3) Using Outlook 4
D Calendar Permissions Outlook 2003, 2007 and 2010 Exchange Server Administration 2
M Outlook 2007 Calendar Reminders Using Outlook 1
H Conflicts with other event in calendar ( outlook 2007 &amp; 2010) Using Outlook 0
P Outlook 2007 - Missing Calendar Item Using Outlook 4
P Outlook 2007 - Missing Calendar Item Using Outlook 1
D Outlook 2007 & 2010 calendar permissions Using Outlook 2
B Scheduling a Meeting Resource (Room) with a conflict doesn't indicate any conflict on users calendar in Outlook 2007 Using Outlook 1
P the outlook 2007 calendar cannot be saved because it was changed by another user or in another windo Using Outlook 4
G How re referance a non defualt outlook 2007 calendar Outlook VBA and Custom Forms 3
S Not receving all email since converting from Outlook 2007 to Outlook Classic Using Outlook 3
D Outlook 2007 Recovering E-Mails Using Outlook 0
W Transfer Outlook 2016 autocomplete file to Outlook 2007 Using Outlook 1
C Outlook 2007 Removing then adding account restores junk email processing Using Outlook 0
S Outlook 2007 crash linked to gdiplus.dll Using Outlook 0
S Outlook 2007 - Automatic purge fail Using Outlook 0
J outlook 2007 doesn't let me choose which .pst to search Using Outlook 2
D Outlook 2007 vs. Outlook 2010 -- ToDo Bar Using Outlook 0
D Outlook 2007 on 365 Using Outlook.com accounts in Outlook 2
S Macro for other actions - Outlook 2007 Outlook VBA and Custom Forms 23
S Verwendung von Outlook 2007 Using Outlook 0
A Arthur needs help with 2007 Outlook e-mail Using Outlook.com accounts in Outlook 3
M PST import from Outlook 2007 to 2010 - Address Book contacts all in 1 group Using Outlook 4
B Migrate Outlook 2007 to Office 365 Using Outlook 3
X I have met my waterloo trying to resolve embedded graphics problem with outlook 2007 and now 2016 Using Outlook 1
R Outlook 2007 only loads some appointments Using Outlook 0
C Move Outlook 2007 to new PC with Outlook 365 Using Outlook 3
J Outlook 2007 Hide Messages Option not Available Using Outlook 2
B Server errors Outlook 2007 Using Outlook 1
S Reboot of frozen windows7 results in changed outlook 2007 settings Using Outlook 1
S Outlook 2007 printing wrong email address at top of page Using Outlook 8
M Configure outlook 2007 to accept digital signatures Using Outlook 2

Similar threads

Back
Top