A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Linking to other .dot files without the full path to dot file - Help please !



 
 
Thread Tools Display Modes
  #1  
Old May 30th, 2004, 10:45 AM
gravesen
external usenet poster
 
Posts: n/a
Default Linking to other .dot files without the full path to dot file - Help please !

HI I have a start dot file I open as the file. This has a main menu that
links to a dot letters. From this file I open the letter that I want by
using this code:

Sub replylettercomplaint()
'
' Replylettercomplaint Makro
' Makro indspillet 16-03-2004 af Lars Gravesen
'
Documents.Add Template:= _
".\Breve\reply_lettercomplaint.dot" _
, NewTemplate:=False, DocumentType:=0
End Sub

This works fine and from this document now open I can open other dot
files. BUT my problem is when I use some of the macros that I have in
the open document for inserting a sentence. When I have inserted /used
a macro all my links to other dot files are broken and does not work.
If I instead use a full path to the documents this error does not
appear. BUT I can't use a full path because I need to run this from a
CD and I do not always know which letter this cd drive will have.

An example of the macro that I am using to insert a sentence is shown
bellow whenever this is run my path to other dot files does not seam to
work.


Sub ViHendlederDeres()
'
' ViHendlederDeres Makro
' Makro indspillet 12-01-2004 af Marianne Lolholm
'
Selection.TypeText Text:= _
"Please forward your price-list and terms of payment. "
Selection.Comments.Add Range:=Selection.Range
Selection.TypeText Text:="Send mig venligst Deres katalog over
kontormøbler"
ActiveWindow.ActivePane.Close


End Sub


Any ideas would be so nice

Thanks
Lars Gravesen


---
Message posted from http://www.ExcelForum.com/

  #2  
Old June 3rd, 2004, 02:25 PM
Cindy M -WordMVP-
external usenet poster
 
Posts: n/a
Default Linking to other .dot files without the full path to dot file - Help please !

Hi Gravesen,

This works fine and from this document now open I can open other dot
files. BUT my problem is when I use some of the macros that I have in
the open document for inserting a sentence. When I have inserted /used
a macro all my links to other dot files are broken and does not work.
If I instead use a full path to the documents this error does not
appear. BUT I can't use a full path because I need to run this from a
CD and I do not always know which letter this cd drive will have.

You could try getting the path dynamically. Something like

ThisDocument.Path

(ThisDocument to be sure it always checks the path where the "main
template" is opened from)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:07 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.