Solved

Word 2003 : Macro Question

Posted on 2007-04-11
2
166 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I would like to show you some basics you can do with Mailings in MS Word. It´s quite handy feature you can use for creating envelopes, labels, personalized letters etc. First question could be what is this feature good for? Mailing can really he…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
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 …

706 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

19 Experts available now in Live!

Get 1:1 Help Now