![]() |
#5
|
|||
|
|||
![]()
Hi,
You know how to create bookmarks in the word template right? So you create bookmarks in your wordtemplate call them so they mean something you remember.. Save both of your excel and your word template in the same folder that makes it a little bit easier to find and code. Ok .. let get started .) In the word document create a modul call it modPublic Write code in there public p_docDO as document so the first Modul is finished. then create a second module call it something like modDatei in there u create a prozedur Code:
Sub UseThisDocument() Set p_docDO = ThisDocument End Sub Write following code Code:
Property Get Textmarke(strName as string)as string UseThisDocument if p_docDO.Bookmarks.Exists(strName)then Bookmarks=p_docDO.Bookmarks(strName).Range.Text Else Textmarke="" End If End Property Code:
Property Let Textmarke(strName as string, strText as string) dim rngTM as range UseThisDocument if p_docDO.Bookmarks.Exists(strName) then set rngTM=p_docDO.Bookmarks(strName).range rngTM.Text=strText rngTM.Bookmarks.add strName Else msgbox "This bookmark is missing: " & strName, vbCritical End if End Property If you created a bookmark with the name DO_Email for example you can test your code in the immidate window like so Textmarke("DO_Email")="office@mynewoffice.co" and press return you will find that the bookmark DO_Email is now set to office@mynewoffice.co So the first step is set up ![]() But that is a different story and for me for today a bit to late but maybe someone else has a bit of time to get you further with this .-) HTH SW |
Tags |
excel vba, excel vba macro sorting, outlook 2010 |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
lcolson | Outlook | 1 | 10-17-2015 04:58 AM |
Outlook macro to check a value of a cell in an attachment and send an email based on that value | ketangarg86 | Outlook | 13 | 03-25-2015 07:11 AM |
Email reminder of an event in outlook calendar | sam2149 | Outlook | 0 | 03-03-2015 05:00 AM |
Outlook will not send email | yourforester | Outlook | 1 | 10-04-2013 05:55 AM |
Use outlook to send text message to a cell phone | TheVillagesFrank | Outlook | 0 | 06-27-2012 01:16 PM |