Macros - Word 2007 and Outlook 2007

G

Guest

Here's my original msg below to another group: "Linda"




(e-mail address removed)...

I upgraded to Office 2007. My macros work fine in Word but now they
do not work in Outlook... they did before. I have many macros defined
but no good if I can't use them in Outlook. For example... I have one
macro that is set up which types about 3 sentences instead of me
having to type this all the time... I just click CTL D. Any ideas...
Thanks, Linda.

.... and here's a response - outlook 2007 doesn't use full-blown Word
2007 as its email editor - it just uses a sub-set of it...


---------- Forwarded message ----------
From: "Bob Buckland ?:-\)" <75214.226(At Beautiful Downtown)compuserve.com>
Date: Nov 8, 8:54 pm
Subject: Word 2007 [Macros for Outlook 2007]
To: microsoft.public.office.setup


Hi Linda,

You may want to use the link below to also post in the MS Office Outlook VBA
group through the link below.

=============
messageQuestion: I have not a clue how to create macros in Outlook 2007...
have created many many macros in Word 2003 that work fine w/the
upgraded Word 2007. Can someone point me in the right direction for
macro creation in Outlook 2007? Too bad MS Ofc 07 doesn't use all of
Word 2007 as it's mail editor... just worked great from a heavy user's
viewpoint. Thanks, Linda. <<
--
Please let us know if this has helped,

Bob Buckland ?:)
MS Office System Products MVP

LINKS
A. Specific newsgroup/discussion group mentioned in this message:
news://msnews.microsoft.com/microsoft.public.outlook.program_vba
or via browser:
http://microsoft.com/communities/newsgroups/en-us/?dg=microsoft.publi...

B. MS Office Community discussion/newsgroups via Web Browser
http://microsoft.com/office/community/en-us/default.mspx
or
Microsoft hosted newsgroups via Outlook Express/newsreader
news://msnews.microsoft.com
 
G

Guest

Hi Sue,

Thanks... I read the tip and followed the example and just updated about 15
macros so they can be used in Outlook 2007 too. I can' claim to know what
this all means but it works! Only 1 other question which I've researched but
need your help... I need to include a hyperlink in one of my macros. I was
able to make the change in Word 2007 for the hyperlink but not sure how to
make this work for Outlook. Here's what I have so far... macro works great
but need www.intersouth.com/about/contact.aspx to show as a hyperlink.
Thanks, Linda.


Sub Directions()
'
' Directions Macro
'
'
Dim objDoc As Word.Document
Dim objSel As Word.Selection
On Error Resume Next
Set objDoc = Application.ActiveInspector.WordEditor
Set objSel = objDoc.Windows(1).Selection
objSel.TypeText "Please visit our website at
www.intersouth.com/about/contact.aspx for directions and parking information
to our office at the American Tobacco Campus."
Set objDoc = Nothing
Set objSel = Nothing
End Sub
 
S

Sue Mosher [MVP-Outlook]

You need to use Word's Hyperlinks.Add method to insert the link. To get an example, I'd suggest that you record a macro in Word that uses the hyperlink dialog (Ctrl+K) rather than relying on the automatic formatting to kick in.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
G

Guest

This is what I have in Word for this macro which works fine in Word but not
Outlook:
Can you just tell me what to type to make this work... too much time spent
already. Thanks very much, Linda.

Directions Macro
'
'
Selection.TypeText Text:="Please visit our website at "
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
"http://www.intersouth.com/about/contact.aspx ", SubAddress:="", _
ScreenTip:="", TextToDisplay:="www.intersouth.com/about/contact.aspx"
Selection.TypeText Text:= _
" for directions and parking information to our office at the"
Selection.TypeText Text:=" American Tobacco Campus."
Selection.TypeParagraph
End Sub
 
S

Sue Mosher [MVP-Outlook]

If you think about it, you'll know what to do next: Apply the same conversion process to this macro that you did to the others. The example you posted earlier shows you already know how to return Word.Document and Word.Selection objects from the open Outlook item.

Another approach is to build the boilerplate text as a QuickPart, which you can then insert with VBA code; see http://turtleflock-ol2007.spaces.live.com/blog/cns!C1013F1F9A99E3D8!158.entry and http://www.outlookcode.com/codedetail.aspx?id=1571
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
G

Guest

Hi Sue,

Thanks for helping me today. I'm going to set this macro up w/the hyperlink
but in the meantime I went ahead and set this up in Quick Parts. I'm going
to get your book this weekend and read it. Thanks again, Linda.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top