Solved

Word 2003 : Macro Question

Posted on 2007-04-11
2
167 Views
Last Modified: 2010-04-30
I would like to insert the path of an active document using this macro but the macro gives a compile error.
What could be causing the error ?
Sub Path()
Dim strThisDocument As String
strThisDocument = ActiveDocument.FullName
Selection.Font.Name = "Verdana"
Selection.TypeText Text: strThisDocument
End Sub
0
Comment
Question by:itbabe
2 Comments
 
LVL 35

Accepted Solution

by:
mvidas earned 500 total points
ID: 18890191
Hi itbabe,

You're missing the = after the : in the TypeText line:

Selection.TypeText Text:=strThisDocument

Similarly, you could just use:
Selection.TypeText Text:=ActiveDocument.FullName

Matt
0
 
LVL 7

Expert Comment

by:gbahri
ID: 18890341
You can also ignore "Text:=" in this case:
e.g.
Selection.TypeText ActiveDocument.FullName

thanks,

GBahri
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nice table. Huge mess. Maybe this was something you created way back before you figured out tabs or a document you received from someone else. Either way, using the spacebar to separate the columns resulted in a mess. Trying to convert text to t…
Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

939 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now